Upgrade PHP 5.1.6 to 5.2.x on CentOS 5.4 – Recommended Method

centoslinuxPHProundcube

It's been awhile since this type of question was asked here. Perhaps the recommended solution has changed.

I have a CentOS 5.4 mail server running RoundCube webmail. By default, RoundCube expects PHP version 5.2 or above. CentOS 5 is stuck at revision 5.1.6 with backports of certain features from 5.2. I disabled the PHP check for Roundcube and it works well. However, one of the plugins I would like to use uses a method introduced in PHP 5.2.

Due to the binding of PHP and Postgres/MySQL in this case, what is the best way to upgrade the PHP version from 5.1.6 to 5.2.x? I've seen 3rd party repos, CentOS testing, Fedora… or I could compile from source. I'd like to keep this system in a stable state so that it doesn't blow apart during the next round of updates.

Any recommendations?

Best Answer

I've done this many times using the atomic repos. In very simple terms, three steps are all that's needed in most situations:

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
yum update php
service httpd restart

I obviously can't guarrente it will work for you, but for myself this has become the standard method.