Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install php5.6 on Centos 7

Install php5.6 on Centos 7

Remi's RPM repository - Configuration wizard, PHP on CentOS 7 (PHP-FPM)

Command to install the Remi repository configuration package:

yum install

Command to install the yum-utils package (for the yum-config-manager command):

yum install yum-utils

The php56 collection is available in the remi-safe repository

Command to install:

yum install php56

Command to install additional packages:

yum install php56-php-xxx

yum install php56-php-mbstring php56-php-memcache php56-php-redis  php56-php-mysqli php56-php-pdo

Command to check the installed version and available extensions:

php56 --version

php56 --modules

Enable php-fpm:

vi /etc/yum.repos.d/remi.repo

Find [remi] and [remi-php56] block, enable this repository, you have to change enabled=0 into enabled=1, after the change the blocks look like this:

name=Remi’s RPM repository for Enterprise Linux 7 – $basearch
name=Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 – $basearch
# WARNING: If you enable this repository, you must also enable “remi”

Save the file. You are now ready to install PHP-FPM

yum install php-fpm

To ensure it also starts automatically with the server, run the following command:

systemctl enable php-fpm


systemctl start php-fpm


This comment has been minimized.

Copy link

Sarfroz commented Feb 1, 2018

instead of editing remi.rpo file we can also use :
yum-config-manager --enable remi-php56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.