Featured

Host Laravel project on cPanel

Step 1:-

First of all, we have to get all the files & directories into laravel_project folder. open your terminal & go inside your project folder,  And run the command php artisan cache:clear. to clear your cache.

then run php artisan config:clear to clear the cached version of your config file, if there is any.

Now make a zip folder of your project’s folder for ex. Laravel_project

host laravel project

Step 2 : – Upload your folder

After login to your cPanel, for uploading folder go to File Manager, & upload your folder in root directory, i have created laravel_project folder in root directory.

 

deploy laravel to shared hosting

Step 3:- 

           Unzip (your project’s folder)laravel_project open laravel_project folder and move all the public folder content into public_html directory. so make sure that, you do not have to keep anything in public folder, it should be blank.

shared hosting laravel

Step 4 :-

keep .htaccess file into public_html & into (your created folder)laravel_project that is outside the public_html. Or copy .htaccess file from public folder & paste it into laravel_project.

laravel hosting

Step 5:-

And Edit index.php file like following way add laravel_project name before /vendor.

laravel shared hosting

Step 6:-

If you have dynamic work done into your project then create database connectivity through your .env file that will be available into laravel_project folder if it is not shown then click on settings on right corner of cPanel on the Preferences window, enable the checkbox show hidden files(dotfiles).


Step 7:-

At the end run your domain on the browser. Like

upload laravel to shared hosting

Comments