INSTALL PHP 7 ON CENTOS

Php 7 is out on December 2015 with advanced features and tweak performance. There are many new things about PHP 7 but the most noted features are its light performance and speedy php processing.

In this article you will see basic methods about how to install PHP7 on Centos.

INSTALL PHP 7 ON CENTOS / RHEL

Installing PHP in CentOS can be done easily using Yum. That way it can be done easier and safer, especially for newbies. There currently two methods you can choose one of it to follow:

Login to your CentOS server as root.

Do yum update to make sure all packages are up to date:

yum update -y

Install Apache 2 web server (httpd):

yum install httpd -y

Add EPEL and Remi repository in your CentOS 7.x:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm

However if you are still using CentOS 6.x, then use this instead:

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm

Now update your yum repo list

yum --enablerepo=remi update remi-release

Now finally you can install PHP 7 using command below:

yum --enablerepo=remi-php70 install php70

You also need to install several common PHP 7 modules. List it using command below :

yum --enablerepo=remi-php70 search php70-

Here’s the command to install PHP modules which are usually needed by many apps:

yum --enablerepo=remi-php70 install php70w-cli php70w-common php70w-bcmath php70w-dba php70w-devel php70w-embedded php70w-fpm php70w-gd php70w-imap php70w-interbase php70w-intl php70w-ldap php70w-mbstring php70w-mcrypt php70w-mysql php70w-odbc php70w-opcache php70w-pdo php70w-pdo_dblib php70w-pear php70w-process php70w-pspell php70w-recode php70w-tidy php70w-xml php70w-xmlrpc

Now you can verify it using below command:

Php –v

Done!!.