How to move Laravel 5.4 application to shared hosting?
Hello, I just created a simple Laravel 5.4 application using some VueJS components. Now I'd like to move it into my shared hosting account (it has www/public_html structure). In a regular php/html application I would move everything into the "public_html" folder. I spent quite some time searching a solution on the web and could not find any working solution. So I would appreciate some step-by-step guide on how to do it? Thanks a lot.
I've got the same situation. Basically what you do is you put everything in your www folder and then rename the Laravel default 'public' folder to 'public_html'.
Then go into server.php and change the two instances of public to public_html.
That should be it!
If you happen to have SSH access to your shared hosting account and you use NPM/Mix to build your CSS files, there's more tweaking to be done. Laravel/Mix uses the public folder to publish the CSS/JS files from your resources/assets folder. In that case, check these files too:
webpack.mix.js
node_modules\laravel-mix\setup\webpack.config.js
public\mix-manifest.json
(Maybe you could also try to symlink public_html to public -- I haven't tried it, but while I'm typing this reply I'm thinking that could actually work too.)
Hi, I will try to follow the instructions on those links you shared. Should I make any changes on my .env file and compile the application as production instead of development? I mean, while working locally on my application I compile it as "npm run dev". Is there any command such as "npm run production"?.
@skoobi I have this same setup where everything in my 'public' directory has been moved to public_html and all the actual app files are in 'laravel' folder. in my index php I had to have this:
So I wasnt sure if there was a typo in your comment. The only issue I have now is the app relative path since it looks for storage stuff in root but its actually in laravel folder and some package files from vendor in root as well, but that is in laravel. Any suggestions?