AndyReed said:
Hello,
I'll be rally grateful if some one can give us instructions on how to install PHP 5.
On our servers we have 2 versions of PHP php-4.3.3 and php-4.3.7. Each version found in two different locations:
/usr/src/fp-5.0-upgrade/buildapache/php-4.3.3/
/home/cpapachebuild/buildapache/php-4.3.7/
I downloaded php-5.0.0.tar.gz distribution to /home/cpapachebuild/buildapache/php-4.3.7/
Now what are the steps to get PHP 5 installed on the servers?
Can I delete the old versions of PHP? If yes, what are the consequences?
Thank you!
Firstly, run /scripts/easyapache in SSH on both machines. choose option 5, this should bring you to php 4.3.8.
then:
cd /home/cpapachebuild/buildapache/
wget
http://www.xmlsoft.org/sources/libxml2-2.6.11.tar.gz
tar zxf libxml2-2.6.11.tar.gz
cd libxml2-2.6.11
./configure
make
make install
now that you have libxml2 (needed by php 5),
cd /home/cpapachebuild/buildapache/
pico buildscript OR nano buildscript
Find the line which says:
XMLVER=2.5.8
and replace it with:
XMLVER=2.6.11
then find the line which says:
PHPVER=4.3.8
change that to:
PHPVER=5.0.0
then find:
if [ "1" = "1" ]; then
PHPVER=4.3.8
fi
replace that with:
if [ "1" = "1" ]; then
PHPVER=5.0.0
fi
Now find this:
cd $TOPLEVEL
./fetchfile libxml2-$XMLVER.tar.gz
if [ ! -e "libxml2-$XMLVER.tar.gz" ]; then
echo "Unable to fetch libxml2-$XMLVER.tar.gz"
exit
fi
and make sure the line above cd $TOPLEVEL is:
if [ "1" = "1" ]; then
make sure the line IS NOT indented like cd $TOPLEVEL is.
Hit Ctrl x to exit, it'll prompt to save or not, hit y then enter and enter again.
now type:
./buildscript
After that completes, it may say httpd cannot start, please contact sysadmin. Not to worry, type the following in:
pico /usr/local/apache/conf/httpd.conf OR nano /usr/local/apache/conf/httpd.conf
find the line which says:
AddModule mod_php4.c
and replace with:
#AddModule mod_php4.c
then find the line which says: (should be above the AddModule lines)
LoadModule php4_module libexec/libphp4.so
replace with:
#LoadModule php4_module libexec/libphp4.so
again hit ctrl x, type y hit enter, enter again. now type httpd start or httpd restart.
You can remove the source files for any older versions of PHP once you have 5.0.0 working.