How to install PHP 5.6 on CentOS 6.10

Published on Author JFLeave a comment

I just did a fresh install of CentOS 6.10 today and needed to install PHP. It had been a while, so I needed a refresher.

Note: PHP 5.6 is pretty much End Of Life, so you should be installing PHP 7.2, or higher at this point in time. That said, sometimes you have to support older systems.

Add some necessary repos:

rpm -Uvh
rpm -Uvh
cd /etc/yum.repos.d
curl -O

Edit rum.repos.d (i prefer nano)

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

The only default repo will be [remi-safe]. Make sure this is enabled.


Then set the [remi-php56] to enabled =1. Default is 0. Make sure to save and close.

You will need to install the latest version of libzip.

yum install -y libzip5

Then install your different php needs. Here’s an example:

yum install -y php php-cli php-common php-gd php-gmp php-mbstring php-mysqlnd php-pdo php-pear.noarch php-pecl-jsonc php-process php-xml runtime php php-devel more-php-mcrypt


Instead of editing yum.repos.d you can use a switch like thus:

yum install -y php --enablerepo=remi-php56

Job done.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.