Downgrade PHP 5.3 to 5.2 in centos 6.2

 

The centos 6.2 normally comes with php 5.3. You can do the following procedures do downgrade the php version to 5.2.

1. Take the copy of the previous installed rpm to any one of the folder.

 

[[email protected] ~]# cd ~
[[email protected] ~]# rpm -qa|grep php > php_module.txt
[[email protected] ~]# cat php_module.txt
php-gd-5.3.3-3.el6_2.8.i686
php-xml-5.3.3-3.el6_2.8.i686
php-xmlrpc-5.3.3-3.el6_2.8.i686
php-mbstring-5.3.3-3.el6_2.8.i686
php-common-5.3.3-3.el6_2.8.i686
php-5.3.3-3.el6_2.8.i686
php-pear-1.9.4-4.el6.noarch
php-imap-5.3.3-3.el6_2.8.i686
php-mysql-5.3.3-3.el6_2.8.i686
php-mcrypt-5.3.3-1.el6.i686
phpmyadmin-2.11.11.3-2.el5.rf.noarch
php-cli-5.3.3-3.el6_2.8.i686
php-pdo-5.3.3-3.el6_2.8.i686

 

2. Remove the existing PHP 5.3 RPM in the server.

 

[[email protected] ~]# rpm -e –nodeps php-gd-5.3.3-3.el6_2.8.i686 php-xml-5.3.3-3.el6_2.8.i686 php-xmlrpc-5.3.3-3.el6_2.8.i686 php-mbstring-5.3.3-3.el6_2.8.i686 php-common-5.3.3-3.el6_2.8.i686 php-5.3.3-3.el6_2.8.i686 php-imap-5.3.3-3.el6_2.8.i686 php-mysql-5.3.3-3.el6_2.8.i686 php-mcrypt-5.3.3-1.el6.i686 php-cli-5.3.3-3.el6_2.8.i686 php-pdo-5.3.3-3.el6_2.8.i686

 

3. Download the corresponding PHP 5.2 version from the “http://www6.atomicorp.com/” webiste.

 

[[email protected] ~]# mkdir php-5.2
[[email protected] ~]# cd php-5.2/
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-cli-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-common-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-gd-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-imap-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-mbstring-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-mcrypt-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-mhash-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-mysql-5.2.17-1.el6.art.i686.rpm
[[email protected] php-5.2]# wget http://www6.atomicorp.com/channels/atomic/centos/6/i386/RPMS/php-pdo-5.2.17-1.el6.art.i686.rpm

 

4. Install the downloaded PHP 5.2 RPM .

 

[[email protected] php-5.2]# rpm -ivh –nodeps php-5.2.17-1.el6.art.i686.rpm php-cli-5.2.17-1.el6.art.i686.rpm php-common-5.2.17-1.el6.art.i686.rpm php-gd-5.2.17-1.el6.art.i686.rpm php-imap-5.2.17-1.el6.art.i686.rpm php-mbstring-5.2.17-1.el6.art.i686.rpm php-mcrypt-5.2.17-1.el6.art.i686.rpm php-mhash-5.2.17-1.el6.art.i686.rpm php-mysql-5.2.17-1.el6.art.i686.rpm php-pdo-5.2.17-1.el6.art.i686.rpm

 

5. Finally restart the webserver.

 

[[email protected] php-5.2]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

 

6. The next important think is to exclude the php in yum.conf. If you are not excluding this line PHP will be upgraded if we enter yum update command in the server.

[[email protected] php-5.2]# cat /etc/yum.conf|grep php
exclude=php*

 

2 thoughts on “Downgrade PHP 5.3 to 5.2 in centos 6.2”

Leave a Reply

Your email address will not be published. Required fields are marked *