Steps to install Laravel on cpanel

Steps to install Laravel on cpanel

Steps to install Laravel on cpanel

Most of them will prefer the Laravel framework since it eases a task commonly in dealing with web projects such as sessions, routing and authentication. So, it’s must to know the installation process of the Laravel framework in the server of cPanel.

There are two types of installation process in the cPanel server:

  1. Using Softaculous for automatic installation
  2. Using Composer for manual installation
Kindly, check the below-listed extensions are present in your server or not.

  • Mcrypt PHP extension
  • Phar PHP extension
  • JSON PHP extension
  • Ctype PHP extension
  • XML PHP extension
  • Tokenizer PHP extension
  • PDO PHP extension
  • Mbstring PHP extension
  • OpenSSL PHP extension
  • PHP version 5.6 +
It is easy to select all the extensions in one form of web hosting method “Select PHP version”.

  1. Using Softaculous for automatic installation;
Step 1: From your cPanel, go to Softaculous apps installer and then search Laravel.

Step 2: Tap on the Laravel so that you will get an option to install it.
laravel.png


Step 3: It will ask you to create a folder name it’s because the installation of Laravel will get stored in the newly created folder.

Step 4: Sometimes, it will give you the option to store in public_html. In this case, no needs to name a folder instead leave it as it is.

Step 5: Finally, tap on the install!

  1. Using Composer for manual installation:
Step 1: For a manual installation, you have to cross-check the presence of SSH access.

Note: A tool is used for project dependency by declaring the libraries, in short, are known as Composer. In other terms, it also meant for PHP dependency management tool.

Step 2: In this step, install the Composer by downloading the file of the composer:

Code:
cd /bin
wget https://getcomposer.org/installer
Step 3: For confirmation of compatibility, before starting the installation run the below-mentioned command to check the installer compatibility

Code:
php installer --check
Step 4: It’s a good sign if you get the successful message after the check of installer compatibility.

Code:
php installer --check
All settings correct for using Composer

Step 5: Finally, it’s the right situation to install the composer. Execute the command mentioned below:

Code:
php installer
Installation of Laravel:

Step 1:
You would have created a folder for Laravel installation right! Redirect to the folder and then execute the command:

Code:
php /bin/composer.phar create-project laravel/laravel {directory_name} --prefer-dist
For instance: If the Laravel needs to get installed in the sub-directory. First name the sub-directory as your choice like changer then change the command name of sub-directory as changer from directory_name.

In case, Laravel gets installed in a folder called public again, you might see a choice of path change as “/changer/public”

If you are not satisfied with the above installing options or else you need to install Laravel in the public folder then use the command for execution:

Code:
ln -s /home/username/laravel/public /home/username/public_html
Note: You have completed the Laravel installation. So, go to the domain to check the welcome message by Laravel.

You have a chance of getting an error when Laravel installation takes place. Here, we have elaborated the existence of error so that you can rectify it easily.

Issues in file permission:

You would have done the Laravel installation properly but still, it shows an error message.

Maybe! The allotment of file permission for directories and files are not in a correct way. Laravel will run properly only if the webserver is writable to cache directories, bootstrap and app/storage directory.

Dealing composer.json file with binaries incorrectly:

You will get an error like Parse error: syntax error, unexpected '['

One simple reason for this error message is incorrect phrases of binaries in file “composer.json”. To correct this error, open the file composer.json and then select the script. Make the necessary changes in binaries so that; the error won’t be available again.

Don’t conclude that the error list is completed. We have given you two types of error with resolution and there is more number of errors occurs in the installation of Laravel. Choose Laravel for the good result of web development feature. It won’t be a big sequence to install Laravel!
Author
bhawanisingh
Views
8,398
First release
Last update
Rating
0.00 star(s) 0 ratings
Top