I'm running Ubuntu 8.04 on this server. I had PHP 5.2 installed via the package manager. I removed it to install PHP 5.3.1 by hand. I built the packages like so
./configure --prefix=/opt/php --with-mysql --with-curl=/usr/bin --with-apxs2=/usr/bin/apxs2
make
make install
This installed PHP 5.3.1 in /opt/php/
$ php -v
PHP 5.3.1 (cli) (built: Dec 7 2009 10:51:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
However, when I try to start Apache I get this.
# /etc/init.d/apache2 restart
* Restarting web server apache2
apache2: Syntax error on line 185 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load:
Cannot load /usr/lib/apache2/modules/libphp5.so into server:
/usr/lib/apache2/modules/libphp5.so: undefined symbol: OnUpdateLong
[fail]
Any ideas what's causing this error? All the references I can see have to do with building php5 packages for php4 or the like. PHP4 has never been installed on this machine.
Best Answer
actually, what James Hackett said was more or less what worked for me.
My problem wasa that I built PHP before I installed Apache (I built PHP from latest trunk and installed Apache2 via APT).
So when I encountered the error that apache encountered an undefined symbol (the module which is not found is arbitrary btw.), I did the following:
make distclean
on the php source./configure --prefix=/usr/local/php-5.3-svn --with-apxs2=/usr/bin/apxs2
make && make install
and everything worked just fine.
Captain obvious was hiding from me, of course since if you just remake without make distclean && configure, make just compiles the new symbols which obviously is not enough ;-)