Now a days PHP frameworks like Laravel, Codeignitor and CakePHP etc getting popular as they provide more security and flexibility. MVC programs are developed fast with these frameworks. Unlike normal core PHP, PHP Frameworks requires installation. We can install Laravel via composer. In this guide we are going to install Laravel 5.0 on LAMP with PhpMyAdmin.
First Lets update
LAMP (Linux + Apache + MySql + PHP) Installation
Now we are going to install the LAMP package which is basic building block for a Linux Server. To install Laravel ,we must need a LAMP server running. If you have already LAMP installed You can skip this step.
The chkconfig command used to set apache automatically on after a server start.
service httpd restart
chkconfig httpd on
Install MySql Server
Now we are going to install MySql server which will handle our databases.
rpm -ivh mysql-community-release-el7-5.noarch.rpm
ls -1 /etc/yum.repos.d/mysql-community*
yum install mysql-server
Now lets start MySql Server
You can restart or stop also by using restart or stop command.
Now lets move to MySql setup, use following command to enter into setup.
Just hit enter as you don’t have any MySql root password. After that enter your desired password and continue. You can use “Y” for all next prompts.
MySql Server Installation Finished.
Install EPEL release and REMI
rpm -Uvh remi-release-7.rpm
Now Open Remi Config file and change Enable 0 to Enable 1 in [php] and [php56] section. Basically help to install PHP 5.6 instead of PHP 5.4.
Use following command to open Remi Config file.
Use following command to install PHP 5.6. Make sure you have edited the remi file via above command else this command will install PHP 5.4.
You can now check your PHP version by using below command
Now we are going to install PhpMyAdmin. Use the below command to install.
Now lets configure the PhpMyAdmin. Open the config file in editor
Just change the value of Require under Apache 2.4 Section
# Apache 2.4
Require all granted
# Apache 2.2
Deny from All
Allow from 127.0.0.1
Allow from ::1
Install PHP dependencies
The Following command will install php dependencies like php-mysql, php-mcrypt, php-mbstring, php-dom.
Install Composer For Laravel
Use the following command to install & setup composer.
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
Setup Virtual Host For Laravel
Now lets make virtual host setup for Laravel. First navigate to /etc/httpd/conf.d folder. use the following command .
Now delete welcome.conf file and create default.conf file.
Add the following lines to default.conf file.
DirectoryIndex index.html index.php
Options Indexes FollowSymLinks
allow from all
CustomLog /var/log/httpd/access.log combined
Save & Exit
Laravel 5.0 Installation
Now lets give permission to respective folders
chmod -R o+w /var/www/html/storage
You are Done. Navigate to your IP. You will see a beautiful Laravel Logo.