Deploy Laravel 11 App on cheap SiteGround Shared cPanel Hosting

SiteGround Shared Hosting Laravel 11 PHP 8.3 App Guide

You Must Git.. on your Local Dev Environment.

Github. New Repository. Git Commit, Git All . , git push owner [repository-url]

git add .

git commit

git branch -M main

git push -u origin main

git remote add origin https://github.com/nortonr/laratest.git

git push origin HEAD:master

Other things lol (not necessary for this)

git clone https://github.com/nortonr/laratest.git laratest   

In the final push, Git wouldnt work for me, i had to switch to Git Desktop and finish on the GUI bc of authentication with password was depleted in 2021.. so yeah.

Inside SiteGround SSH Terminal (using iTerm2 on imac):

Run commands below inside main app folder where main app files are…

composer install

php artisan key:generate

php artisan config:clear

Clear SiteGround Cache under Speed > Chacing > Dynamic Cache Tab…

Oh, and I was using SQLite, didn’t find many tutorials or posts on using anything other than MySQL, but this worked with simply filebased SQLite.

See the generic .env file that worked for me on Siteground:

APP_NAME=Laravel

APP_ENV=local

APP_KEY=base64:uGWUnL0+fBxCi/60+Ld4Rk+8ZbTRM0yRCisXWo8GVd0=

APP_DEBUG=true

APP_TIMEZONE=ET

APP_URL=https://localhost

APP_LOCALE=en

APP_FALLBACK_LOCALE=en

APP_FAKER_LOCALE=en_US

APP_MAINTENANCE_DRIVER=file

APP_MAINTENANCE_STORE=database

BCRYPT_ROUNDS=12

LOG_CHANNEL=stack

LOG_STACK=single

LOG_DEPRECATIONS_CHANNEL=null

LOG_LEVEL=debug

DB_CONNECTION=sqlite

# DB_HOST=127.0.0.1

# DB_PORT=3306

# DB_DATABASE=laravel

# DB_USERNAME=root

# DB_PASSWORD=

SESSION_DRIVER=database

SESSION_LIFETIME=120

SESSION_ENCRYPT=false

SESSION_PATH=/

SESSION_DOMAIN=null

BROADCAST_CONNECTION=log

FILESYSTEM_DISK=local

QUEUE_CONNECTION=database

CACHE_STORE=database

CACHE_PREFIX=

MEMCACHED_HOST=127.0.0.1

REDIS_CLIENT=phpredis

REDIS_HOST=127.0.0.1

REDIS_PASSWORD=null

REDIS_PORT=6379

MAIL_MAILER=log

MAIL_HOST=127.0.0.1

MAIL_PORT=2525

MAIL_USERNAME=null

MAIL_PASSWORD=null

MAIL_ENCRYPTION=null

MAIL_FROM_ADDRESS=”hello@example.com”

MAIL_FROM_NAME=”${APP_NAME}”

AWS_ACCESS_KEY_ID=

AWS_SECRET_ACCESS_KEY=

AWS_DEFAULT_REGION=us-east-1

AWS_BUCKET=

AWS_USE_PATH_STYLE_ENDPOINT=false

VITE_APP_NAME=”${APP_NAME}”

Share the Post:

Related Posts