Skip to content

Instantly share code, notes, and snippets.

Embed
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 http://rpms.remirepo.net/enterprise/remi-release-7.rpm

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:

[remi]
name=Remi’s RPM repository for Enterprise Linux 7 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/7/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
…
[remi-php56]
name=Remi’s PHP 5.6 RPM repository for Enterprise Linux 7 – $basearch
#baseurl=http://rpms.remirepo.net/enterprise/7/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/7/php56/mirror
# WARNING: If you enable this repository, you must also enable “remi”
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-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

Running:

systemctl start php-fpm

@Sarfroz

This comment has been minimized.

Copy link

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.