How to Install PHP 5.2.X on CentOS 5

Last modified by slith on Thu, June 24, 2010 15:23
Source|Old Revisions  

The Remi repository install only supports the latest PHP version, which is currently 5.3.X. After searching around, I found PHP 5.2.X is still available from the CentOS testing repository.

Start by adding the CentOS testing repository to yum

  cd /etc/yum.repos.d

Then import the gpg key for this repository as follows:

  rpm --import

Now you are ready to install PHP 5.2.X from the CentOS repository (c5-testing).

  yum --enablerepo=c5-testing install php
  // other necessary extensions
  yum --enablerepo=c5-testing install php-mhash php-mcrypt
  yum --enablerepo=c5-testing install php-gd
  yum --enablerepo=c5-testing install php-xml php-xmlrpc

Or, If you are updating from an older PHP version:

  yum --enablerepo=c5-testing update php

That’s it!

If you are doing a fresh LAMP install with Mysql:

  yum --enablerepo=c5-testing install php-mysql mysql mysql-server
  /sbin/chkconfig --levels 235 mysqld on
  /etc/init.d/mysqld start

Or, to just update Mysql:

  yum --enablerepo=c5-testing update mysql

Hope this helps...

How to Install PHP 5.2.X on CentOS 5 in VPS hosting with plesk

You can use the atomiclinux repository and update you php using this lazy command:

  wget -q -O - |sh