Laravel is a free open-source which is a PHP web application framework. To install Laravel in cPanel you need to follow these steps:
Laravel automatic installation via the Softaculous script installer
Step 1: Log into your cPanel. Click on Softaculous option. Type Laravel in the search bar.
Step 2: Click on the Install button.
Laravel manual installation with Composer
Step 1: Open your SSH client, put your domain name or the IP address of the server into the Host Name field, enter the Port number, choose SSH as your connection type and press the Open button.
Step 2: Enter your cPanel username and password for access. Type the php -v command in PuTTY to check the php version.
Step 3: To set up 5.5 version, you need to go Software and Services section > Select PHP Version menu. Select 5.5 version from the drop-down menu and then click on the Set as current button.
Step 4: You need to decide where you wish to put your Laravel installation. For example, we will create laravel_folder in public_html using the following command.
cd public_html && mkdir laravel_folder && cd laravel_folder
Step 5: You need to copy php.ini file from the default location on the server to your laravel_folder using this command:
cp /opt/alt/php56/etc/php.ini /home/username/public_html/laravel_folder
Step 6: Now you will need to find the php.ini file in the current location. Go to File Manager menu. Move to the folder you have chosen for Laravel and open php.ini with Editor.
Then add the following code to the end of the file and hit Save button:
max_execution_time = 300
max_input_time = 300
memory_limit = 512M
suhosin.executor.include.whitelist = phar
detect_unicode = Off
Step 7: When all the preparations are done, you are ready to install Composer and then Laravel. Open PuTTY window where you have logged into your cPanel account and fill in the following command:
php -r "readfile('https://getcomposer.org/installer');" | php -c php.ini
Step 8: Now you are ready to install Laravel. Execute the command provided below:
php -c php.ini /home/username/public_html/directory/composer.phar create-project laravel/laravel --prefer-dist
Step 9: Once the installation is successfully completed, you will get this output