Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

I’m going to show you how to upgrade PHP 5.3 to PHP 5.4 on CentOS 6.7. This article is assuming that you are running the CentOS 6.7 default version of PHP 5.3.

All the credit goes to this blog post, I am just reposting here for my records, but for once, the guide worked perfect without needing changes and it wasn't long and "overexplained" which I don't like, really well done, thank you!
https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-4-on-centos-6-7/

1. Confirm your version of PHP is the CentOS 6.7 default

Type in the following:

rpm -qa | grep php

Should output similar to the following

php-cli-5.3.3-46.el6_6.x86_64
php-common-5.3.3-46.el6_6.x86_64
php-5.3.3-46.el6_6.x86_64 
Great, let’s move on.

2. Install and activate the REMI and EPEL RPM Repositories

Type in the following to download and install the required files:

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 

Now to enable the REMI repository globally:

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

[remi]
#enabled=0
enabled=1 

3. Update PHP from 5.3 to 5.4

Easy as pie, simply type in the following:

yum -y update php* 

Once that’s done, we can verify:

rpm -qa | grep php 

And we should see something similar to the below:

php-common-5.4.45-1.el6.remi.x86_64
php-5.4.45-1.el6.remi.x86_64
php-cli-5.4.45-1.el6.remi.x86_64 

Make sure PHP is working correctly:

php -v

You should see something similar to the following:

PHP 5.4.45 (cli) (built: Sep 2 2015 18:54:00) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies 
  • No labels