PHP 5.5.13 on CentOS 6.5 with yum

With distros such as RHEL and CentOS, they typically have a 7-10 year lifetime, it's difficult to keep them up to date with the latest versions of things. Your only options are to:

  1. go without it
  2. build it from source yourself
  3. use a 3rd party repository that provides alternative packages

I typically go with #3. You can use this repo to install 5.5:

  • https://webtatic.com/packages/php55/

To install the repo:

$ sudo rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

To install the packages:

$ sudo yum install php55w php55w-opcache

This is one of many 3rd party repos that provide packages in this manner. Always make sure that you're OK with using these repos, prior to just jumping in and using them. Some are better than others, but I've never run into an issue with using their builds of packages.

Using remi repo

This repo does provide the 5.5 packages of PHP, you just need to know how to tell it that that's what you want.

Setting up repo, if not already

$ sudo wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
$ sudo wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
$ sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

This will upgrade PHP from 5.3.3 to PHP 5.4.24 (15. January 2014).

$ sudo yum --enablerepo=remi update -y

If you want the newest PHP, version 5.5.x you must run the following command:

$ sudo yum --enablerepo=remi,remi-php55 update -y

References

  • Upgrading PHP from 5.3 to 5.4 or 5.5 on CentOS 6.5 with Virtualmin

You don't need 3rd party repos, there is SCL: https://wiki.centos.org/AdditionalResources/Repositories/SCL

The wiki is old, it currently supports php 5.6. After installing SCL, do a "yum search rh-php56" and you will see all php 5.6 related packages.

The catch is that all SCL packages are not installed on the usual directories so they can co-exist with other versions. They install under /opt using in a chroot-like tree. It may be what you want or not.

Tags:

Php

Centos