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

vinschi's avatar
Level 16

Deploy laravel 5.4 app in shared hosting

Hi guys, it's time to deploy my first app on a shared hosting server (forpsi.com). Is there a guide to do it? I have no idea how to do it. Please help me. Thanks

0 likes
11 replies
vinschi's avatar
Level 16

Hi @bobbybouwmann at first thanks for your link but I think I have a problem (of course maybe simply because it's my first time and I don't know how to do it): I can access to the cpanel of my hosting and I have an installer tab with 4 type of applications drupal, wordpress, joomla and prestashop. How can I install composer if I don't have the terminal? Thanks for the patience

spekkionu's avatar

Look around your cpanel for SSH/Shell Access. A lot of shared hosts do not allow it and some require you to pay extra but if it there you can ssh into the server to run composer commands.

If you can't run composer managing this app will be pretty painful and I suggest dumping your host for one that you get at least jailed shell access to.

If not anytime you want to update your app you will have to run your composer commands locally then replace the vendor folder on the server with the new copy.

kehator's avatar

If you will not be able to do it on your hosting, then I can recomended ovh.com. I was using a shared hosting for a while and it has limited ssh access (enough to run laravel), but it's a bit more complicated. If you will need a help, then ask customersupport, they are very helpful.

However I prefere VPS which is in the same price like shared hosting (with my hosting provider) but I have a full controll and that is awesome (more advanced)

vinschi's avatar
Level 16

@spekkionu so the worst case scenario is that I have to upload the vendor directory after I compile locally? I don't plan to update this app so much so it could be doable. The problem however is that looks like there is no ssh but only ftp, can I cheat in this way? :)

Thyrosis's avatar

Yes, sure you can. You don't actually need ssh access to run a production site.

When you're finished developing your application, just transfer all the files online via ftp to your shared hosting package and you're good to go. Make sure you check out where to pur your files though: Usually there is something like a public or public_html folder. This should correspond to the public folder from Laravel. In other words, all other files should be outside it.

shaikh709's avatar

@VINSCHI I had the same problem. What I did I created a subdomain called web and changed subdomain directory location from public_html/web to public_html/web/public and placed index.php with below code.

    header('Location: http://web.domain.com');

and everything worked fine. But this is temporary solutions.

vinschi's avatar
Level 16

Sorry for the late response but I was on a small holiday. Basically I have a hosting with an apache server, I have the www folder where I created inside a folder laravel and uploaded all the folders of the laravel application in this way:

|---www |----laravel |----log

I copied the content of the public folder inside the laravel folder at the same level of /app, /bootstrap etc and I changed both the server.php and index.php files with the correct path.

The website is still not visible, what I'm doing wrong? @shaikh709 @jlrdw @Thyrosis @kehator @spekkionu @bobbybouwmann Thanks for helping

Thyrosis's avatar

I might be understanding you incorrectly, but the way it should look is this:

-home folder

--app/

--bootstrap/

--config/

--database/

--logs/

--resources/

--routes/

--stats/

--storage/

--tests/

--vendor/

--www/

--.env

--artisan

--some composer/phpunit/package files

--server.php

Now, the www in this setup is YOUR www. It used to be Laravel's 'public' folder, which you renamed to www (or you just moved the contents of the public folder to the www folder.

Hope that makes sense?

Please or to participate in this conversation.