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

    Hello, My Name is Brijpal Sharma. I am a Web Developer, Professional Blogger and Digital Marketer from India. I am the founder of Codermen. I started this blog to help web developers & bloggers by providing easy and best tutorials, articles and offers for web developers and bloggers...

0 Comment

You must be logged in to post a comment.