- First, remove all traces of the existing PHP.
A crude (but effective) approach is to grep for php in all of the yum packages,
and then do a "yum remove" on each package.
For example, as root:
yum list all | grep php | (while read a b; do echo "yum remove $a"; done) > cleanup.sh
Then examine cleanup.sh carefully before you run it:
chmod 700 cleanup.sh
(and be prepared to answer 'y' to several yum prompts.)
- Install the Apache and MySQL development packages:
yum install httpd-devel.x86_64
yum install mysql-devel.x86_64
- Download and unpack the PHP source.
- Configure and build PHP thusly:
./configure --with-apxs2=/usr/sbin/apxs --with-mysql=/usr --with-libdir=lib64 --enable-mbstring
- Install. Assuming the 'make' succeeds, do:
service httpd stop
service httpd start