How can I install Laravel on cPanel?

RachitP

Managed Hosting Specialist
Hosting Provider
Registered
Joined
Jun 21, 2018
Messages
22
Points
3
How can I install Laravel on cPanel? Is there any specific steps to install Laravel?
I am looking forward to hearing your thoughts!
 

BlueLeaf

Well-known member
Registered
Joined
Apr 11, 2017
Messages
199
Points
18
I heard more about Laravel, is it a programming language?
Yep, a free, open-source PHP web framework created by Taylor Otwell and first released just 7 years ago. So it's a newcomer:) You can get the history and technical aspects from Wiki, but I'll leave a couple of snippets from Laravel's official website:

Laravel is a web application framework with expressive, elegant syntax.
Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as authentication, routing, sessions, and caching.
 

hostguy

Member
Registered
Joined
Sep 9, 2020
Messages
49
Points
6
I would recommend this to install Laravel application in cpanel.
Earlier i also tried this but get issue then i follow all these steps and my application is working fine now.
 

sam@12

Member
Registered
Joined
Jun 8, 2021
Messages
62
Points
6
Yes you can install the Laravel framework can be installed on cPanel accounts using PHP's composer.
Here is the steps
# cd /bin
#wget https://getcomposer.org/installer
#php installer –check
#php installer
#php /bin/composer.phar create-project laravel/laravel –prefer-dist
#rm -rf public_html
# ln -s laravel/public/ public_html
 

RoseHosting

Well-known member
Hosting Provider
Registered
Joined
Jun 16, 2016
Messages
93
Points
8
You do not have to install it by yourself. There are hosting companies that can do that for you. Some of them offer fully managed support.
You can follow these points while you are choosing the best hosting company for you:
-Check the web host’s server uptime record
-Check if they offer multiple add-on domains
-Ask about the company’s refund policy.
-Find out what a basic contract offers.
-Check for specialty features.
-Always check the reviews
 

Kaz Wolfe

Well-known member
Registered
Joined
Jul 7, 2016
Messages
609
Points
28
I will show you how to install Laravel on a cPanel server. Laravel is the PHP Github framework and also the most preferred framework of PHP developers. This tutorial should also work on other Linux VPS systems but has been tested and written for a cPanel VPS.

This guide requires that you already have:

PHP 5.6.4 or later (PHP 7 is better)
OpenSSL, Mbstring, PDO, Tokenizer, PHP and XML extensions
Apache

1. Login to your VPS via SSH

Code:
ssh root@my_server
2. Update the system and install the necessary packages

Code:
yum update
yum install git curl
3. Install composer

Composer is a dependency manager for PHP with which you can install packages. Composer will pull all the required libraries and dependencies you need for your project.

Code:
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
4. Install Laravel
Installing Laravel is a pretty simple process, in this article we will install Laravel using composer create-project command.

Switch to the root of the domain:

Code:
cd /home/USERNAME/public_html/
and install Laravel using the composer create-project command (Make sure to include a dot (.) at the end of the command.):

Code:
composer create-project --prefer-dist laravel/laravel .
If you are logged in as root or another sudo user, you will need to set the correct ownership and permissions:

Code:
chown -R USERNAME: USERNAME /home/USERNAME/public_html/
Don't forget to change 'USERNAME' with your actual username.

5. Configuring cPanel
We need to edit the default web root document server and change it from public_html to public as required by Laravel.

Change Document Origin for Addon Domain
Login to your cPanel at: https://YOUR_SERER_IP:2083 and under the 'Domains' section click on 'Addon Domains'. In the new window you will see a list of all your addon domains, click the edit icon next to the domain's document path and enter the new path /public_html/laravel-addon-domain.com /public.

6. Change the Document Origin for a Primary Domain
In order to change the Document Primary domain/master root, you need to have SSH root access to your server. Open the following file:

Code:
nano /var/cpanel/userdata/USERNAME/MY_LARAVEL_DOMAIN.COM
and change the documentroot value, just add public at the end of the path, for example:

Code:
documentroot: /home/USERNAME/public_html/public
If you have an SSL certificate for your domain, you will also need to edit the documentroot value in the following file:

Code:
/var/cpanel/userdata/USERNAME/MY_LARAVEL_DOMAIN.COM_SSL
Don't forget to change 'USERNAME' with real username and MY_LARAVEL_DOMAIN.COM with real domain.

Finally, save the file and rebuild the Apache configuration:

Code:
/scripts/rebuildhttpdconf && service httpd restart
You have successfully installed and configured Laravel on cPanel. For more information about Laravel please refer to official Laravel documentation.

Hope it helps!
 

Martingray

New member
Registered
Joined
Jun 8, 2022
Messages
2
Points
1
Don't go with too many complexities. Simply opt for Managed Laravel Hosting, where you will get a pre-installed dedicated Laravel server with all the required features in clicks and also free website migration with 24*7 support.
 

webhostingworld

Member
Registered
Joined
Jan 14, 2022
Messages
50
Points
6
first, you will need to log in to the control panel (c-panel).
then choose a softaculous app installer from the list of software under the software tab.
Then, in the search bar, type Laravel, and on the following window, click the install now button.
on the following page, complete the requested information and select the quick install option.
Then, select the Install option.
 
Newer Threads
Replies
1
Views
1,340
Replies
20
Views
6,477
Replies
11
Views
3,155
Replies
6
Views
2,047
Latest Threads
Replies
1
Views
26
Replies
0
Views
188
Replies
1
Views
40
Replies
2
Views
83
Recommended Threads
Replies
41
Views
14,620
Replies
10
Views
5,781

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top