How To: Install PHP 5.3 on CentOS 5.1 or RHEL 5.1 January 7, 2011Posted by Tournas Dimitrios in Linux.
PHP 5.2 and PHP 5.3 has tons of functionalities which are not provided by PHP 5.1 (it has more OOP targeted features ) . PHP 5.1 is the most recent version of PHP available in CentOS 5.x and RHEL 5.1 via updates. Also, its difficult for people to upgrade OS(s) on production servers frequently and especially if the servers are running absolutely fine, it doesn’t really make sense to upgrade just for the heck of it. One more reason for no upgrades is the OS choices provided by many hosting companies. But a lot of CMS(s) and softwares are now recommending at least PHP 5.2 for an extended feature set.
I tried a lot of repos for CentOS including RPM Fusion, RPM Forge, EPEL etc., but none of them could provide even PHP 5.2. In some corner of my mind, I had a faint idea of Remi Collet publishing updates about Remi repository. Did a quick google search and found out that PHP 5.3 is actually available in the repository
So, if you are really in need of PHP5.3 on your CentOS/RHEL 5.1 or lesser, head over to Repository Configuration Page and follow the instructions.
For Centos 5.x follow these steps :
- cd /etc/yum.repos.d
- wget http://rpms.famillecollet.com/enterprise/remi.repo
- yum – -enablerepo=remi update php php-* mysql-*
- service httpd restart
Note : The remi repository is not enabled by default , instead of enabling it via his configuration file , use the ” –enablerepo=remi ” switch argument . Restart your web server so that the updated php engine can be enabled .