Configure Laravel Project After Deploy On Shared Hosting Cpanel - FreeCodeBlog

Last updated: Dec 09, 2021

Did you deploy the Laravel project to the shared hosting cpanel? Yes. Good, Have you configured the Laravel project after deploying on the shared hosting cPanel? Actually no. Listen, You need to configure laravel project after deploy on shared hosting cpanel. But why? Okay at first you tell me that have you used database, mail, session and more information in your Laravel project? Yes. Don't want to configure database, mail, session, robots, sitemap on laravel project which you uploaded to cpanel? Yeah I want to configure these on cpanel. Okay then you must need to configure laravel project after deploy on cpanel shared hosting.

 

Configure Laravel Project After Deploy On Shared Hosting Cpanel
Configure Laravel Project After Deploy On Shared Hosting Cpanel

 

1. Deploy Laravel Project.

You need to deploy a laravel project on shared hosting cpanel to configure URL, database, mail, session and more connection. I have already created lots of tutorials on deployment Laravel on Shared Hosting Cpanel. If you don't know how to deploy Laravel project on shared hosting cpanel, feel free to read 3 ways to upload laravel projects to shared hosting cpanel tutorial.

 

2. Database Connection.

Have you setup a Laravel project on shared hosting cpanel? Now you need to change laravel database connection cpanel. I have created a tutorial on database connection on shared hosting cpanel. please read change laravel mysql database connection on shared hosting cpanel tutorial.

 

3. Mail Connection.

Have you used user email verification in your Laravel project? Now you need to configure laravel mail connection after deploy on shared hosting cpanel. Don't forget to read laravel mail configuration on shared hosting cpanel tutorial. Note that mail cannot be sent or you may get error without a mail configuration.

 

4. Change URL.

After uploading laravel in cpanel you need to change the app URL from the laravel env file. You can also change the app URL from the config app file. You should use a better version URL of your domain. If you don't use app URL you may get error in asset files.

 

APP_URL=domain-url

 

5. Redirect Website.

Don't want to use multiple websites in the same domain? You need to use the htaccess file to prevent duplicate URL error. You should read carefully how to use htaccess file to redirect website tutorial if you don't like to use multiple websites at once.

 

6. Laravel Session.

Laravel session can be problem after deploy on shared hosting shared hosting cpanel. Especially when you try to use the laravel file session on cpanel. You may encounter database or file session errors in production. So you need to fix laravel session problem from your laravel project after deploy on cpanel shared hosting. Please read how to fix laravel session error on shared hosting cpanel tutorial to fix session error.

 

7. App Debug.

Don't want to see any laravel error details in cpanel? If you don't want the viewer to see the details of the error, turn off the app debug option from the laravel env file. I suggest you turn off the app debug option on shared hosting cpanel.

 

APP_DEBUG=false

 

Okay so this is for today. See you again next tutorials. Thanks

Post Tags
Post Writer
masum7323
Masum Biswas (@masum7323)

My name is Masum Biswas. I'm a full stack developer. I live in Bangladesh and I love to write tutorials and tools that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, MySQL, VueJS, Tailwind CSS and Bootstrap from the early stage.

Follow Me On
Related Posts
Laravel Ui Email Verification Complete Tutorial

Want to make laravel ui vue, react, bootstrap email verification using laravel ui version 3, 2, 1? Laravel ui has a feature for users to verify ema... Read More

Run The Laravel Artisan Command On The Shared Hosting Cpanel.

Need to run laravel artisan command on shared hosting cpanel? If so, please don't forget to read this tutorial slowly and carefully. Laravel artisa... Read More

How To Create Ftp Accounts On Cpanel Shared Hosting

Want to create a FTP account from cpanel? Yes. Create and configure FTP Accounts to get your website on the internet fast. You can use an FTP clien... Read More

How To Use Laravel Mailtrap To Send Email

Mailtrap in laravel! Want to send fake email to mailtrap dashboard using laravel? Yes. Want to send laravel email notification to mailtrap? Yes. Do... Read More

Make A Laravel Pdf Generator Using Barryvdh Dompdf

Make a laravel pdf generator in laravel using barryvdh dompdf. You can easily generate a pdf file from a HTML file using DomPDF. To export into PDF... Read More