If you use Red Hat Enterprise Linux or CentOS for client projects or for your company you’ve probably stared at the following line: Requirements: PHP 5.2 or better. Yet, when checking back to see what PHP is actually available through the standard yum repos you find… no PHP 5.3 and not even PHP 5.2. Visions of dependencies flash through your mind.

Luckily, there are PHP RPM alternatives. Let’s take a look at where to start.

The Power of Community

Update: Please see the clarifications and comments below from the IUS Community as well. Thanks! — RWH.

There is good news for the weary developer or sysadmin seeking an up to date and well maintained RPM for PHP5.x releases. From the IUS Community Project FAQ:

The IUS Community Project is an effort to package rpms of the latest stable versions of the most commonly requested software on Red Hat Enterprise Linux and CentOS. IUS provides a better way to upgrade PHP/MySQL/Python/Etc on RHEL or CentOS. The project is run by professional Linux Engineers that are primarily focused on RPM Development in the web hosting industry.

Getting started with IUS is very straight forward and you’ll find “a better way to upgrade rhel” for more than just PHP.

Once you’ve completed the steps outlined for updating to reflect the IUS Yum Repository you can expect to see what you once thought was impossible.

Example of final step for upgrading a stock RHEL5.x system to PHP 5.3 system:

A Name You Can Trust

One concern with repos is who might be behind them. Are they reliable? Can they be trusted? Does the repo maintainer own a copy of the movie Glitter? Serious questions are serious! Accepting any old repo you find on the Internet is just plain unacceptable.

Fear not! Simply refer to the SafeRepo Initiative and know that the IUS Community is sponsored by the fine folks at Rackspace. In fact, you can find IUS linked on php.net under “Binaries for other systems”.

Feel better? Now what do you want phpinfo() to return on your RHEL server?

Let us know in the comments below!