Pushing/ Deploying laravel 5.0 to Bluehost shared hosting server

I have no problem installing laravel using composer on my computer and run it using the command php artisan serve –port 8888. Then the page is served at localhost:8888.

I tried to move all the laravel files to my Bluehost shared hosting server. It is a subdomain, ixoviresume.shaunlgs.com, there is a ixoviresume folder inside my www folder. Inside the ixoviresume folder, there is a public folder, which the file index.php exists. You have to configure your subdomain, pointing it to public folder instead of the ixoviresume, so you need to point it one folder deeper.

This will solve the issue where the website will display a lists of laravel file directory when you go to ixoviresume.shaunlgs.com. Alternatively, you can try to add .htaccess to redirect any requests to public folder. Put this .htaccess file in your ixoviresume folder.

After you configure the above, you should be able to display your website at ixoviresume.shaunlgs.com instead of going to ixoviresume.shaunlgs.com/public. Next, I faced an issue, that is, the ixoviresume.shaunlgs.com gives me an 500 server not found error. I found out by checking the error_log file in public folder that I have this error

[29-Nov-2015 06:32:04 America/Denver] PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /public_html/ixoviresume/public/index.php on line 50

I checked online, this issue is due to my server’s php version is not updated to use for laravel 5.1. So, I delete my laravel and redownload a laravel 5.0 via composer create-project laravel/laravel ixoviresume 5.0.* . After you use laravel 5.0, you may still face issue.

Because you don’t have the vendor folder. But you cannot execute composer install at Bluehost, so you need to manually upload the vendor folder from your computer to server. Alternatively, you can remove vendor folder from .gitignore file, so that when you git pull at your server’s ssh, you can have the vendor folder without using composer.

One thought on “Pushing/ Deploying laravel 5.0 to Bluehost shared hosting server”

  1. Shared hosting is affordable, but they are not a good option for hosting a Laravel app. A better alternative is a vps. They are affordable and faster than shared. If someone doesn’t know how to setup a vps, they can use PaaS, like Cloudways Laravel hosting for that. All you have to do is just select the server size and storage and datacenter location, the platform will setup the server automatically for you. OS, stack, Laravel and workflow tools, like Git and Composer will be already installed on the server.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.