Skip to content

How to deploy Laravel project on Shared Hosting using cPanel

Step 1: Zip archive all contents inside your project directory.

Step 2: Upload the Zip file into hosting directory. Extract the same inside the hosting directory.

Step 3: Move all files from “public” folder to the hosting directory.

Step 4: Edit “index.php” in the root directory and change the path like following.

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


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

Step 5: Edit “server.php” in the root directory and change the path like following.

// require_once __DIR__.'/public/index.php';
require_once __DIR__.'/index.php';

Leave a Reply

Your email address will not be published. Required fields are marked *