How To Install PHP 5.6 Using YUM ON CentOS/RHEL 6/7?

How To Install PHP 5.6 Using YUM ON CentOS/RHEL 6/7?

PHP  is one the latest version of PHP in IT industry and many modules/ libraries function has been useful in PHP 5.6. This newer version of PHP 5.6.30 was made public CentOS/RHEL. PHP 5.6 got support for PEAR install and pecl has got deprecation so webtatic repository keeps deprecated libraries for support.

Here with the end of this article, we will learn how to install PHP 5.6 on CentOS/RHEL 6.x using YUM from Webtatic repository.

Scenario: My Server IP is
OS CentOS: 6.9

Note: If you are a SUDO user then prefix every command with sudo, like #sudo ifconfig

Step1: Install Required repositories

To install PHP 5.6 we require Webtatic EL repository and EPEL repository will be required as a dependency for this repository installation:

CentOS/RHEL 7.x:


CentOS/RHEL 6.x:


Step 2: Install PHP With Webtatic

After first step 1, you can install PHP 5.6 with a simple command.

Step 3: Look For PHP Modules

As PHP 5.6 is installed but your application may require a various module to process. PHP 5.6 also have a list for a wide variety of useful libraries and modules which you can add to your PHP. If you want to look for available PHP modules type in the following command:

Output Will be

Step 4: Install A module

Now as per your production and deployment requirement you can install any module listed. Here we are installing php56w-opcache and php56w-fpm as an example.

Well, Congratulations! You have successfully Installed PHP 5.6.30


Step 5: Check Your Installation

As you have successfully installed our custom PHP version, we need to verify its version and location of installation

Output Window will be like:

Also, check which version of PHP your shell is using:

Output Window:

Watch Video:

YouTube Link

You may also Like

  1. How To Install PHP using YUM
  2. How To Set Up LAMP Environment With Apache MySql And PHP: Part-1

Watch Video

Source [PHP Site]