Deploy Laravel Application To Shared Hosting The Easy and save Way



This post explains about deploy Laravel application to shared hosting the easy and saves way.

After completed Laravel applications we need to deploy on shared hosting.

If we Laravel application files and folders we can see a  public folder first zip this folder (only public folder) after that zip all remaining folders. 

Deploy Laravel Application To Shared Hosting The Easy and save Way

Now we have two folder 

  1. Public folder
  2. All remaining folder (Not included Public folder)

Deploy Laravel Application To Shared Hosting The Easy and save Way

Now Login to your Cpanel you can see many folders one of them is  public_html. upload public zip file into public_html and unzip the file. after that create a new folder in the main directory named what you want.

 

Deploy Laravel Application To Shared Hosting The Easy and save Way

Here a named "name" folder in this folder upload the second zip file and extract.

After that back to the public_html folder open index.php file and set a right path. 

Deploy Laravel Application To Shared Hosting The Easy and save Way

 

Open the index.php file and update it.


require __DIR__.'/../project/vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../project/name/bootstrap/app.php';

Now every this is done now you can check your live URL 

Note: If you get any issue please check to flow points

  1. Update PHP version higher. 
  2. Update .env file with database. 

So here we completed the tutorial on Deploy Laravel Application To Shared Hosting The Easy and save Way


About Author
  • user profile
    Brijpal Sharma

    brijpalsharma99@gmail.com, January 29th, 2018

    Hi, I am a web developer, I working on Laravel and CodeIgniter framework, I love to share knowledge and tutorials so I here...


0 Comment


You must be logged in to post a comment.


You may also be interested in...
jQuery plugin to validate the maximum length of the field and count characters.
Deploy Laravel Application To Shared Hosting The Easy and save Way
Laravel advance search filters with optional fields.
Laravel Migrations: Check if Table/Column Already Exists
Connect Multiple databases in the same Laravel project
SEO tool for Laravel Application
Paypal payment gateway integration in Laravel 5.7 step by step
How to Check User online or not in Laravel
How to keep filter data after the click to next button in Laravel pagination
Which is better for web development, Laravel or Flask?