Menu

Install PHP 7.0, Apache 2.4, & MySQL 5.6 on CentOS / RHEL 7.1 & 6.7

Few days ago most awaited PHP version 7.0 has been released. which has many number of changes and improvements than over version 5.X. This article will help you to install PHP 7 Apache 2.4 and MySQL 5.6 on CentOS / RHEL 7.1 & 6.7 operating systems. This tutorial has been tested with CentOS 7.1, so all the services command are used with systemctl, For CentOS 6 users change all systemctl command correspondence service command.

1. Setup Yum Repository

In the first step install all the required yum repositories in your system used in remaining tutorial for various installations. You are adding REMI, EPEL, Webtatic & MySQL community server repositories in your system.

CentOS / RHEL 7

# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# rpm -Uvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

CentOS / RHEL 6

# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
# rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
# rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

2. Install PHP 7

Now install php 7 packages from webtatic rpm repository using following command.
# yum install php70w
Now install required php modules. Use following command to list available modules in yum repositories.
# yum search php70w
Now check all listed modules in above command and install required modules like below.
# yum install php70w-mysql php70w-xml php70w-soap php70w-xmlrpc 
# yum install php70w-mbstring php70w-json php70w-gd php70w-mcrypt
After installing php and other php modules restart Apache service.
# systemctl restart httpd.service

3. Install Apache 2.4

Apache (HTTPD) is the most popular web server used on Linux systems. Let’s install Apache web server using following command with enabling epel and remi yum repositories.
# yum --enablerepo=epel,remi install httpd
Now start httpd service and enable to start on boot using below commands.
# systemctl start httpd.service
# systemctl enabel httpd.service

4. Install MySQL 5.6

In step 1 we already have installed required yum repository in your system. Lets use following command to install MySQL server on your system.
# yum install mysql-server
Apply security on mysql and also set root user password.
# systemctl start mysqld.service
# mysql_secure_installation
Now restart MySQL service and enable to start on system boot.
# systemctl restart mysqld.service
# systemctl enable mysqld.service

5. Open Port in Firewall

Finally open firewall ports for http (80) and https (443) services using following command.
# firewall-cmd --permanent --zone=public --add-service=http 
# firewall-cmd --permanent --zone=public --add-service=https 
# firewall-cmd --reload

6. Check Installed Version

Let’s check the installed versions of packages on system using following commands one by one.
# php -v

PHP 7.0.0 (cli) (built: Feb  2 2016 20:42:32) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

# httpd -v

Server version: Apache/2.4.6 (CentOS)

# mysql -V

mysql  Ver 14.14 Distrib 5.6.28, for Linux (x86_64) using  EditLine wrapper
Now you have successfully configured LAMP setup on your CentOS / RHEL 7.1 & 6.7 system.

About Author:


I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Next
Newer Post
Previous
Older Post

0 comments:

Post a Comment

 
Top