|
Hello everyone, this article will describe how to install Laravel on CentOS 7 / Ubuntu 15.04. If you are a PHP Web developer, you do not need to consider how to choose an array of modern PHP framework, Laravel is most easily get up and running, it saves time and effort, allowing you to enjoy the fun of web development. Laravel believed in a universal development philosophy, through simple instructions to create maintainable code that is the highest priority, you will maintain high-speed development efficiency, you can change at any time without fear of your code to improve existing functionality.
Laravel installation is not complicated, you just follow this article step by step operation can be installed on a CentOS 7 or Ubuntu 15 servers.
1) Server Requirements
Before installing Laravel need to install some prerequisite its dependencies, mainly some basic parameter adjustment, such as upgrading the system to the latest version, sudo permissions and install dependencies.
When you connect to your server, make sure that you can pass the following command can be used successfully EPEL repository and upgrade your server.
CentOS-7
#yum install epel-release
# Rpm -Uvh https://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# Rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#yum update
Ubuntu
# Apt-get install python-software-properties
# Add-apt-repository ppa: ondrej / php5
# Apt-get update
# Apt-get install -y php5 mcrypt php5-mcrypt php5-gd
2) Install a firewall
System firewall and SELinux settings for applications for product safety is very important, when you use the test server when you can turn off the firewall, the line set SELinux to tolerance mode (permissive) with the following command to ensure that the installation program from their effects.
# Setenforce0
3) Apache, MariaDB, PHP installation
Laravel installation program needs to be done to install the entire LAMP environment, you need to install additional OpenSSL, PDO, Mbstring and Tokenizer and other PHP extensions. If the LAMP is already running on your server you can skip this step and confirm the necessary PHP plug-in is installed.
To install the complete AMP you need to run the following command on your server.
CentOS
#yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring
To achieve MySQL on CentOS 7 / Mariadb service at startup, you need to run the following command.
#systemctl start httpd
#systemctl enable httpd
#systemctl start mysqld
#systemctl enable mysqld
After starting MariaDB service, you need to run the following command to configure a sufficiently secure password.
#mysql_secure_installation
Ubuntu
# Apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql
4) Install Composer
Before we install Laravel, let us start the installation composer. Installation composer is one of the most important steps to install Laravel because composer help us install Laravel various dependencies.
CentOS / Ubuntu
Run the following command in CentOS / Ubuntu to configure the composer.
# Curl -sS https://getcomposer.org/installer | php
#mv composer.phar / usr / local / bin / composer
# Chmod + x / usr / local / bin / composer
composer installation
5) install Laravel
We can run the following command to download Laravel installation package from github.
#wget https://github.com/laravel/laravel/archive/develop.zip
Run the following command to extract the installation package and move the document root directory.
# Unzip develop.zip
#mv laravel-develop / var / www /
Laravel to install all the required dependent directory now use compose command.
# Cd / var / www / laravel-develop /
# Composer install
compose laravel
6) Key
To encrypt a server, we use the following command to generate a 32-bit key encrypted.
# Php artisan key: generate
Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully
Now put the key into the 'app.php' file, as shown below.
# Vim / var / www / laravel-develop / config / app.php
Key encryption
7) virtual hosts and their user
After the composer installed, assign document root directory permissions and user belongs to, as shown below.
# Chmod775 / var / www / laravel-develop / app / storage
# Chown-R apache: apache / var / www / laravel-develop
Open the default configuration file apache server using any one editor in the final document added to the virtual host configuration.
# Vim / etc / httpd / conf / httpd.conf
ServerName laravel-develop
DocumentRoot / var / www / laravel / public
start Directory / var / www / laravel
AllowOverrideAll
Directory close
Now we use the following command to restart apache server, open a browser to view the localhost page.
CentOS
#systemctl restart httpd
Ubuntu
# Service apache2 restart
8) Laravel 5 Network Access
Open your browser and enter the IP address configured or fully qualified domain name (Fully qualified domain name) you will see the default page of Laravel 5.
Laravel Default
to sum up
Laravel framework for developing web applications is an excellent tool. So, I read this article you will learn to install Laravel on 7 Ubuntu 15 and CentOS, then you can use this awesome PHP framework provides a variety of comfort and convenience features to make your development work. |
|
|
|