How to upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7AndyZ Blog 45 reviews Facebook'sTwitter Google +Reddit
In this article, I'll show you how to upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7.
This article assumes that you have installed CentOS and that you have installed PHP 5.3
1. Verify the current version of PHP
Type the following to view the current PHP version:
php -v
The output should be as follows:
PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
OK, now we can move on!
2. Install the Remi and Epel rpm repositories
If you have not done so, install the Remi and Epel repositories
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm
To enable the Remi repository globally:
nano /etc/yum.repos.d/remi.repo
Make the following changes in the section below [Remi]:
[remi]
name=Remi‘s RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
In addition, the following changes are made in the following section of [Remi-php55]:
[remi-php56]
name=Remi‘s PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/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
Type Ctrl-o to save and press Ctrl-x to close the editor
3. Upgrade PHP 5.3 to PHP 5.6
now we can upgrade PHP. just type the following command:
yum -y upgrade php*
After the update is complete, verify that you have installed PHP 5.6:
php -v
You should see the output similar to the following:
PHP 5.6.14 (cli) (built: Sep 30 2015 14:07:43)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
How to upgrade PHP 5.3 to PHP 5.6 on CentOS 6.7