A good guide for shared hosting:
http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm trying to deploy a laravel project on shared-hosting, and i can make it work to see and browse the project on the domain. but the database.
I have a directory on the root called laravel and a the public folder files all in public_html folder, and modified the index.php to be able to see the laravel folder on the root.
here's my .env file :
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=myuser
DB_PASSWORD=mypassword
gives an error :
SQLSTATE[28000] [1045] Access denied for user 'myuser'@'localhost' (using password: YES)
i know, sometimes i need to config clear and cache clear. but in my case, whenever i make a change in the .env file, i can see it on the error. so it maybe refreshing continuously without requiring do call these commands. like if i change myuser to anotheruser i can see the change in the error, even i don't see a file called config.php in bootstrap/cache directory.
i tested a file that contains mysqli connection to the same database with the exact same credientals, and it successfully connects. the laravel thing doesn't dunno why.
i'm running Cpanel version 78.0.38 on shared hosting with php version 7.3.10. and i can clearly see there's no prefix before the database name and database user name. like oldschool cpanel. so i assume i don't need to include the prefixes as it is appearing in phpmyadmin without it.
Pdo :
What causes this issue?
Thanks.
Please or to participate in this conversation.