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
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
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.
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)
@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? :)
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.
Another excellent guide from our friend @Snapey is
http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/
Works good if uploading a project rather than an in place install.
@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.
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
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?
Ok, let's try again, read @Qlic answer here, do it exactly like @Qlic describes.
https://laracasts.com/discuss/channels/laravel/upload-project-laravel
This is for when you are using ftp to upload the site. Took me just a few minutes (upload time) to be up and running on a godaddy shared site following the guide.
Please or to participate in this conversation.