skip to Main Content

In this article, I’m going to show you how to upgrade PHP 5.3 to PHP 5.5 CentOS 6.7.

This article assumes you have a stock installation of CentOS, and that you already have PHP 5.3 installed

 

1. Verify current version of PHP

Type in the following to see the current PHP version:

php -v

Should output something like:

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

Great, now we can move on!

 

2. Install the Remi and EPEL RPM repositories

If you haven’t already done so, install the Remi and EPEL repositories

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Enable the REMI repository globally:

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

Under the section that looks like [remi] make the following changes:

[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

Also, under the section that looks like [remi-php55] make the following changes:

[remi-php55]
name=Remi's PHP 5.5 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php55/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php55/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 CTRL-X to close the editor

 

3. Upgrade PHP 5.3 to PHP 5.5

Now we can upgrade PHP. Simply type in the following command:

yum -y upgrade php*

Once the update has completed, let’s verify that you have PHP 5.5 installed:

php -v

Should see output similar to the following:

PHP 5.5.30 (cli) (built: Oct 1 2015 09:29:18) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

You’re done!

Sponsored Links

This Post Has 15 Comments

    1. Hello,
      Can you please post the output of “rpm -qa | grep php” and the output of “yum -y upgrade php*”

  1. I get this errors:
    No Match for argument: phpspec.yml
    No package phpspec.yml available.
    No Match for argument: phpunit.xml
    No package phpunit.xml available.
    No Packages marked for Update

    1. This article was written for stock installations of PHP 5.3. If you’ve got extra modules installed it’s going to throw errors.

  2. Hi
    I get this output
    [root@geeniedee /]# yum -y upgrade php*
    Loaded plugins: fastestmirror
    Setting up Upgrade Process
    Loading mirror speeds from cached hostfile
    * base: mirror.amsiohosting.net
    * epel: http://ftp.nluug.nl
    * extras: mirror.amsiohosting.net
    * remi: nl.mirror.babylon.network
    * remi-php55: nl.mirror.babylon.network
    * remi-safe: nl.mirror.babylon.network
    * updates: mirror.nforce.com
    No Match for argument: php*
    No package php* available.
    No Packages marked for Update

  3. What are Remi and EPEL RPM for? Are they PHP 5.5 dependencies? I was hoping to see some explanation on that before I blindly install them.

Don't be shy, leave a reply!