HOW TO : Upgrade PHP 5.x

@how@

Verified User
Joined
Mar 2, 2005
Messages
965
Location
Kingdom of Bahrain
Hello,

How to upgrade PHP to PHP Version 5.1.4 :)

if you use Apache 2.0 just do this
Code:
cd /usr/local/directadmin/customapache
rm -fr build
wget http://files.directadmin.com/services/customapache/build
chmod 755 build
./build update
./build clean
wget http://www.php.net/get/php-5.1.4.tar.gz/from/this/mirror
perl -pi -e 's/PHP_VER=4.4.2/PHP_VER=5.1.4/' build
./build php_ap2
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.safe.copy
perl -pi -e 's/LoadModule php4_module /usr/lib/apache/libphp4.so/#LoadModule php4_module /usr/lib/apache/libphp4.so/' /etc/httpd/conf/httpd.conf
perl -pi -e 's/AddType application/x-httpd-php .inc .php .php4 .php3 .phtml/AddType application/x-httpd-php .inc .php .php5 .php4 .php3 .phtml/' /etc/httpd/conf/httpd.conf
/sbin/service httpd restart

Tested & work fine ;)

*****
edit /etc/httpd/conf/httpd.conf and search for
Code:
LoadModule php4_module /usr/lib/apache/libphp4.so
add # before (LoadModule)
Code:
#LoadModule php4_module /usr/lib/apache/libphp4.so
and
search for
Code:
application/x-httpd-php
and add php5 like this
Code:
application/x-httpd-php .inc .php .php5 .php4 .php3 .phtml
*****



Wael
 
Last edited:
still cool tho :D waiting for eaccelerator to support 5.1.x before i upgrade, is apc ready for 5.1.x yet?
 
koh said:
still cool tho :D waiting for eaccelerator to support 5.1.x before i upgrade, is apc ready for 5.1.x yet?

> php -v
PHP 5.1.4 (cli) (built: May 19 2006 05:15:28)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with eAccelerator v0.9.5-beta2, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.0.0, Copyright (c) 1998-2006, by Zend Technologies

work fine eAccelerator v0.9.5-beta2
 
well i was hoping to wait for stable, but still thanks, I'll probably use beta2 first :D
 
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

*** There was an error while trying to configure php. Check the configure.php file



:(
 
Doesnt work im using centos 3.6.

[root@server public_html]# yum install libxml-devel
Gathering header information file(s) from server(s)
Server: CentOS-3 - Addons
Server: CentOS-3 - Base
Server: CentOS-3 - Extras
Server: CentOS-3 - Updates
Finding updated packages
Downloading needed headers
libxml-devel is installed and is the latest version.
No actions to take
[root@server public_html]#
 
I'm also in Centos and I'm also encountering this same problem:

Code:
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

*** There was an error while trying to configure php. Check the configure.php file

Edit: I think that

yum install libxml2-devel

may have fixed it.
 
Last edited:
[root@server root]# yum install libxml2-devel
Gathering header information file(s) from server(s)
Server: CentOS-3 - Addons
Server: CentOS-3 - Base
Server: CentOS-3 - Extras
Server: CentOS-3 - Updates
Finding updated packages
Downloading needed headers
Resolving dependencies
....Unable to satisfy dependencies
Package libxml2-devel needs libxml2 = 2.5.10, this is not available.
[root@server root]#
 
[root@server root]# yum install libxml2
Gathering header information file(s) from server(s)
Server: CentOS-3 - Addons
Server: CentOS-3 - Base
Server: CentOS-3 - Extras
Server: CentOS-3 - Updates
Finding updated packages
Downloading needed headers
libxml2 is installed and is the latest version.
No actions to take
[root@server root]#
 
Same problem on Debian what should I do?

On Debian (Apache 2) I run
apt-get install libxml2
and it installed libxml2 properly.

When I run the line
./build php_ap2
I get the same error again
"
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

*** There was an error while trying to configure php. Check the configure.php fi
le"

How checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.

*** There was an error while trying to configure php. Check the configure.php file

How can this problem be solved on Debian ?

Update : I found the solution. On Debian run apt-get install libxml2-dev
 
Last edited:
I searched the whole internet I guess, but I don't know how to install libxml-devel under my os freebsd 5.4. It's not available through ports, and the only way to download it seems to be an rpm package. (and i'm dying to use php5 :rolleyes: )
 
These steps just crashed my Centos 4.3, any ideas?


Trying to make mHash...
make all-recursive
make[1]: Entering directory `/usr/local/directadmin/customapache/mhash-0.9.1'
Making all in lib
make[2]: Entering directory `/usr/local/directadmin/customapache/mhash-0.9.1/lib'
if /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT mhash.lo -MD -MP -MF ".deps/mhash.Tpo" \
-c -o mhash.lo `test -f 'mhash.c' || echo './'`mhash.c; \
then mv -f ".deps/mhash.Tpo" ".deps/mhash.Plo"; \
else rm -f ".deps/mhash.Tpo"; exit 1; \
fi
mhash.c:105: warning: initialization from incompatible pointer type
mhash.c:105: warning: initialization from incompatible pointer type
mhash.c:105: warning: initialization from incompatible pointer type
mhash.c:107: warning: initialization from incompatible pointer type
mhash.c:107: warning: initialization from incompatible pointer type
mhash.c:107: warning: initialization from incompatible pointer type
mhash.c:112: warning: initialization from incompatible pointer type
mhash.c:112: warning: initialization from incompatible pointer type
mhash.c:112: warning: initialization from incompatible pointer type
mhash.c:117: warning: initialization from incompatible pointer type
mhash.c:117: warning: initialization from incompatible pointer type
mhash.c:117: warning: initialization from incompatible pointer type
mhash.c:122: warning: initialization from incompatible pointer type
mhash.c:122: warning: initialization from incompatible pointer type
mhash.c:122: warning: initialization from incompatible pointer type
 
It killed out sshd, but I had a DA session open so I went into services and restarted sshd and I could get back in.. I told it not to recompile mhash this time and it worked.

Thanks
 
Wael, the command "perl -pi -e 's/LoadModule php4_module /usr/lib......" gave me a syntax error. Something about a space and the -e. I did not try the one below it and I had already edited the build script by hand so I did not use that one either. I edited the files manually and all worked fine. Running Apache 2.0 on CentOS 4.3.

Questions:

1. Do the things like mhash and zzip etc etc need to be compiled again. I was not sure since I was changing the PHP version so much I went ahead and built them all.

2. Do we need to build Zend again if we are already running 3.01? Phpinfo says it is installed but the php.ini is now in the default place rather than where Zend moves it when you build.install it.
 
Last edited:
DamnSkippy said:
Wael, the command "perl -pi -e 's/LoadModule php4_module /usr/lib......" gave me a syntax error. Something about a space and the -e. I did not try the one below it and I had already edited the build script by hand so I did not use that one either. I edited the files manually and all worked fine. Running Apache 2.0 on CentOS 4.3.

Questions:

1. Do the things like mhash and zzip etc etc need to be compiled again. I was not sure since I was changing the PHP version so much I went ahead and built them all.

2. Do we need to build Zend again if we are already running 3.01? Phpinfo says it is installed but the php.ini is now in the default place rather than where Zend moves it when you build.install it.

1. I don't think you will need to recompile things like mhash and zzip again

2. I think it's be wise to install it again just to be safe (tho I do install them again after recompiling php) lol
 
Back
Top