on PHP5

New Articles

PHP FTP Client.

Perl Mysql and Blobs

The case of the missing errors.

Installing PHP 5

I have been putting off installing and trying out the new version of PHP for a long long time. It's supposed to contain many improvements over the previous versions including better support for object oriented programming. Of course that itself has prompted critics to claim that PHP5 is beginning to look like java. The answer to that is you can still use procedural programming with the new version.

If you already have a PHP-4.3 installation the configure command you used in that installation is a good starting point for installation version 5. You can find this information in the config.status file. In my case it turned out to be:

	./configure  --enable-xslt --with-xslt-sablot 
 	--with-gd --with-zlib --with-mysql=/usr/local/mysql/

Unfortunately the configure script wouldn't run to completion it complained about a missing libxml2 and stuttered to a stop.

configure: error: libxml2 version 2.5.10 or greater required
A quick look inspection of the RPM database with rpm -qa | grep libxml revealed the following:

libxml is installed but not the right version as indicated by the error. Since the normal practice when upgrading a library is to choose the latest stable version i chose libxml2-2.6.5 and promptly corrupted my RPM database.

After spending a couple of hours undoing all the changes and installing libxml-2.5.10 everything seemed to be in order and the configure script this time around ran to completion. Unlike php 4.x make and make install went smoothly as well. In the previous versions when linking against Sablotron additional measures were needed to links against libc++

The only hiccup in the process occurred when attempting to restart the webserver. It would stop but not start again. The problem turned out to be in the httpd.conf file. The installer had added support for the new version without disabling the older PHP 4 installation and that had lead to a conflict. Commenting out the following line in the apache configuration file solved this problem.

	#LoadModule php4_module        libexec/libphp4.so

Another restart followed by a quick look at phpinfo() reveals that my web server is now using PHP 5. None of the web apps or my websites don't seem to be complaining except for phpMyAdmin. phpMyAdmin complains about a missing 'HTTP_SERVER_VARS' and refuses to start up. Oh well it is anyway time to replace mysql with postgresql.