Setup Laravel 5.1 in Shared Hosting

A few week ago, i got client who want to create website. When finish, he just own shared hosting.

For your information laravel recommended if using VPS.

First make sure your shared hosting have requirements :

  • PHP >= 5.5.9
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension

  1. On your local computer install Laravel. If you already setup composer for laravel, you just type laravel new sharedhosting
  2. Create folder name local and assets
  3. Move all file excepts local, and assets to directory local
  4. Open folder local > public and move all file to your root directory
  5. In file index.php (on root directory laravel) change :

    1. require __DIR__.’/../bootstrap/autoload.php’; to require __DIR__.’/local/bootstrap/autoload.php’;

    2. $app = require_once __DIR__.’/../bootstrap/app.php’; to $app = require_once __DIR__.’/local/bootstrap/app.php’; to

  6. Open http://localhost/sharedhosting and you will see blank page. You must type sudo chmod -R 777 local/storage. and open http://localhost/sharedhosting , Lol error again 🙁In your root directory type mv .env .env.example local/ . Open again http://localhost/sharedhosting
    Horray 🙂
  7. On your root directory (Laravel) compress all file and move into your shared hosting.And extract your file
    Open your url shared hosting and yay it’s work 🙂

And sorry my english is bad 🙁