Shared hosting is where most Laravel apps go live first. It is cheap, it comes with cPanel, and it hides one nasty fact: Laravel was built for a server you control, and shared hosting is not that server. I have watched the same five mistakes break deployments over and over. Each one looks like a different error on screen, but the cause is always one of these.
1. Putting the whole project inside public_html
This is the most dangerous one. Shared hosting serves everything in public_html/ to the internet. Upload your full Laravel project there and anyone can open yourdomain.com/.env and read your database password, app key and mail credentials.
Fix: keep the project in a folder next to public_html β for example /home/username/laravel-app/ β and expose only the contents of Laravel's public/ folder. Point the domain at public/ with a document-root change, or forward requests there with one .htaccess rule. The app key and .env file never become reachable from a browser.
2.β¦