HOW-TO Roll Back your PHP *when all else fails*
Alright, so you've installed some version of PHP5 and you realized something didn't go right. Maybe some sites aren't 5.0 compatible. Maybe you're having some server issues. For me, one big client needed 4.4.0 and I don't want to run both 5 and 4 on the same server.
Now I need to uninstall PHP 5.1.1 to gain functionality again.
Like the foothills of a bad relationship, all the frustration and seclusion that ends with the statement, "It's not you. . . it's me. . . I just want to get on with my life."
So, I've rolled back to PHP 4.4.0 using Gpan's RPMs
( refer to this thread http://forums.ev1servers.net/showthread.php?t=56844 )
Give Gpan loads of thanks and love. . . Standard disclaimers apply if not all goes right with this procedure. I'll help how I can, but BE VERY CAREFUL. You're literally breaking things to put them back together.
STEP 1 :
Now, first thing you do is download all the RPMs you're going to need for this and put them in their own directory.
This is what I did for RHEL 3
mkdir php440
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
If you need RHEL 4,
Read this thread: http://forums.ev1servers.net/showthread.php?t=56844 and follow Gpan's instructions.
Now, try install them using
rpm -Uvh php*.rpm
Make notes of all the "php 5.1.1 is newer"
you'll have to [ rpm -e --nodeps ] each package that is preventing you from installing 4.4.0
Like this :
rpm -e --nodeps php
rpm -e --nodeps php-xmlrpc
Once that's done, try installing the PHP 4.4.0 RPMs again
rpm -Uvh php*.rpm
STEP 2 : Resolving Dependencies.
The two RPMs I found missing were JS and Sablotron.
Make another folder for these:
mkdir depends
Get the JS ( includes the dreaded libjs.so.1 ) :
RHEL 3:
wget http://dag.wieers.com/packages/js/js-1.5-0...el3.rf.i386.rpm
wget http://dag.wieers.com/packages/js/js-1.5-1...el3.rf.i386.rpm
wget http://dag.wieers.com/packages/js/js-devel...el3.rf.i386.rpm
RHEL 4 and other compilations here:
http://dag.wieers.com/packages/js/
rpm -Uvh js*.rpm
Sablotron I grabbed from Cheetaweb (all hail Gpan)
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
wget http://mirror.cheetaweb.com/redhat/3ES/i38...el3.ct.i386.rpm
rpm -Uvh sablo*.rpm
Once the dependencies are taken care of go back to step 1 and install.
STEP THREE : Cleaning up
Now, you need to do the following:
cd /etc/php.d
remove the following files
bcmath.ini
dba.ini
dom.in,
soap.ini
xsl.ini
cd /etc
cp php.ini php.ini.back1 (essentially, just backup your php.ini)
pico php.ini
find the section with [bmath] and erase that whole section - save the file.
now do a:
/usr/local/sbin/set_pre_maintenance
/usr/local/sbin/set_maintenance
/usr/local/sbin/set_post_maintenance
service webppliance restart
Now, everything is working again, but I rebooted the server just in case. (If it's going to crash and I need a restore. . . I want it to do so in front of me, not at 1:45 am on Saturday when I'm stumbling around at the clubs and a client is screaming into my voicemail).
Good luck, I hope this is helpful, or at least points you in the right direction