Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shiran1's avatar

how to host Laravel 8 app in a shared hosting(Namecheap)

I want to host my Laravel app in a sub-domain in Namecheap shared hosting?? can anyone refer me to any resources

0 likes
7 replies
kkhicher1's avatar

@shiran1

  1. first create a subdomain and remember folder ( make sure you have php >= 7.3 selected)
  2. compress your laravel project (in zip)
  3. upload your project to subdomain folder
  4. uncompress project on same subdomain folder
  5. change documentroot of your subdomain directly to laravel public folder like - home/public_html/subdomain/public
  6. if you have sql data ? import that and change .env database connection values
  7. Done
1 like
TsoTne's avatar

WoW! Thank you man. I have tried a lot of ways, read a lot of articles about how to deploy laravel project on shared hosting, but nothing interesting. But your simple way is the best.

thanks again <3

rabbithole's avatar

Using kkhicher1 solution the .env file is exposed. If you go to your main domain and follow the path you can load the .env file for display in a browser. For example say your subdomain is blog.mytestsite.com and you main domain is www.mytestsite.com. If you enter in www.mytestsite.com/blog.mytestsite.com/.env the file will gladly open up and expose your database password and other settings.

Please or to participate in this conversation.