CentOS Hack – How to Upgrade from PHP 5.1.6 to 5.2!
For those of you who are trying to upgrade from PHP 5.2 because your application requires PHP 5.2 or above, you can use this hack to upgrade your web server running CentOS. Since CentOS doesn’t officially support PHP 5.2 officially yet, this could possibly be a great workaround.
Word of caution, this hack has worked fine for me for a new Twitter app site I am making that requires use of PHP 5.2 but if you have non-standard customizations to your server, you might want to test it first.
I’ve also found that JSON library that comes with PHP 5.2 is like 20 times faster rather than trying to run separate JSON libraries with PHP 5.1.6. It made a HUGE difference let me just say in page loading times. (Like .90 seconds versus 0.003 seconds.)
This guide describes how to upgrade the standard PHP 5.1.x packages in CentOS 5.x 32-bit to the current development versions 5.2.x. These instructions were created using CentOS 5.3 32-bit and with the following PHP packages installed:
# rpm -qa |grep php
php-common-5.1.6-15.el5.i386
php-cli-5.1.6-15.el5.i386
php-5.1.6-15.el5.i386
php-pdo-5.1.6-15.el5.i386
php-bcmath-5.1.6-15.el5.i386
php-ldap-5.1.6-15.el5.i386
php-devel-5.1.6-15.el5.i386
php-gd-5.1.6-15.el5.i386
php-xml-5.1.6-15.el5.i386
php-mbstring-5.1.6-15.el5.i386
php-mysql-5.1.6-15.el5.i386
php-dba-5.1.6-15.el5.i386As long as you’re using the standard PHP packages on your CentOS server you won’t need to do anything extra. If you’re using extra PHP packages that aren’t part of the standard CentOS repositories (like php-mcrypt) you’ll have to remove them or find updated versions of them.






