Problems upgrading from PHP 5.1.6 to 5.2.9

I have a web server running Fedora Core 5 (yes, I know it's very old) and it was running PHP 5.1.6 so I downloaded and compiled the source for 5.2.9 and restarted the server and phpinfo() still returns 5.1.6.

$ which php
/usr/local/bin/php

But when I do the version switch on this PHP installation I get

$ /usr/local/bin/php -v
PHP 5.2.9 (cli) (built: May 26 2009 10:17:42) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

What may I have missed or how could I correct this?


A number of things could've gone wrong. You could be loading the wrong shared library. Apache could be built with a static library of the older version of PHP. If you installed fedora with PHP/Apache support out of the box it could have the php binary in a non-standard place.

I'd first check httpd.conf to see if it's either a shared module, CGI, or statically library. If it's a shared module you need to rebuild PHP. If it's CGI then you'll just need to change the directory. If it's statically built you'll need to rebuild Apache.

Re: http://www.php.net/manual/en/install.unix.apache.php


Seems that you compiled with /usr/local prefix.

Your Apache is probably loading old PHP from it's default location. Grep though Apache .conf files looking for LoadModule php5_module and change it to load new module from /usr/local.