I spent two days thinking on how I could make Laravel running on Shared Hosting (though I believe this will also work on dedicated server). I am sick of obsolete tutorials found in the internet which gave me no luck. I also tried installing the backward version which is Laravel 4 but still no luck and gives me this error. See the error screenshot below:
This article will tell you on how to install it in a unix environment but still didn’t work at my end, perhaps I miss some configs or whatever. Laravel 4 seems to have many path correction on its file in order to work in your server. Now, I discover a simple way to do that.. even an idiot like me.
Easy Installation for Laravel 5
1. Download Laravel 5 on github and extract it to ‘laravel’ folder which contains
app/ bootstrap/ config/ database/ public/ . .
.. and etc
2. Upload it to your server outside your DocumentRoot or public_html using FTP
3. Copy all files inside the laravel/public/ folder and move it to public_html/subfolder/ that will like this
4. Now! This seems to be tricky! yet it only has simple solution. Edit index.php
Just change this line from
require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';
to
require __DIR__.'/../../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../laravel/bootstrap/app.php';
There’s no need to change index.php file when you install it to DocumentRoot main folder like public_html/ or www/
The bold text laravel is where all your laravel files installed.
5. Presto! You will see this screen when it was correctly configured.
Sometimes it is helpful to search for the information in the internet, but make sure you will not get the outdated one :D Also it is better to figure it out first by your own or see their documentation.
For safety measures, I suggest to put the 3rd party application outside the DocumentRoot or public_html (as what I did), and also I just learn it from other articles. Also check the PHP requirement for this software (> PHP 5.3), you can go to your cpanel and set it to PHP 5.4 or 5.5.
Good luck!