How to install Laravel in WHM/cPanel server
Installing Laravel in a WHM/cPanel server
Laravel is a PHP framework used to develop PHP based applications in Linux systems. Laravel is especially designed for easy development of web applications. It supports multi-platform and allows the users to develop the MVC web applications. Installation of Laravel in cPanel is explained in this manual.
To install Laravel dependencies
Before starting with the installation, enable the shell access in the cPanel. Run the following command to download the Composer and also change the directory to bin.
[root@linuxhelp ~]# cd /bin
[root@linuxhelp /bin]# wget https://getcomposer.org/installer
--2016-09-21 14:20:16-- https://getcomposer.org/installer
Resolving getcomposer.org... 87.98.253.108, 2001:41d0:a:7b19::2
Connecting to getcomposer.org|87.98.253.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 293630 (287K) [application/octet-stream]
Saving to: “ installer”
100%[=================================================================================================> ] 293,630 321K/s in 0.9s
2016-09-21 14:20:20 (321 KB/s) - “ installer” saved [293630/293630]
Now check the compatibility of the installer by running the following command.
[root@linuxhelp /bin]# php installer --check
All settings correct for using Composer
Once the compatibilty is successfully verified, download the php installer.
[root@linuxhelp /bin]# php installer Downloading... . . . Composer successfully installed to: /bin/composer.phar Use it: php composer.phar [root@linuxhelp /bin]# rm -f installer
After installing the composer, continue as user to proceed further.
Navigate to the cPanel user’ s directory and run the following command to install Laravel.
[user@linuxhelp ~]$ php /bin/composer.phar create-project laravel/laravel --prefer-dist
After installing the Laravel, point Laravel’ s public directory to public_html directory as a symbolic link as shown below.Before you point it to the public_html directory remove the public_html directory.
[user@linuxhelp /home/user]$ rm -rf public_html
[user@linuxhelp /home/user]$ ln -s laravel/public/ public_html
Once all the setup is done, open the browser and navigate to the respective domain. In my case " laravel.linuxhelp.com" .
Comments ( 3 )
Click the button that says Customize next to Currently Installed Packages
Click PHP Extensions
Search for Fileinfo in the search bar and select the extensions you would like to install