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.
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 ;-)
I had this same problem and what I did was delete my php source directory, re-extract the tarball and then compile again and everything worked fine.
I had previously installed php on this system without apache and then I had tried reinstalling php from the same source directory with different config settings.
You built php5 but you did'nt rebuilt the glue between apache and php5. Since you are using mod_php5, it fails (logical).
You may be able to run php script thanks to fastcgi (I assume your built-by-hand php 5.3.1 is ok), but anyway I recommend you to act in another manner.
That's pretty nasty to build a software by hand on a production server. Moreover PHP5 is a big piece of software, you really should not do that for maintenance and security purposes.
The correct way to achieve this, if you really need that version, is to backport the package. (yes, packaging !)
It require a bit of packaging knowledge and time. You can get the packaging sources with:
apt-get source php5
, provided you have a deb-src source in /etc/apt/sources.listfor those of you experienceing the zend_parse_paramater error from apache2, while loading libphp5.so:
/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: zend_parse_parameters
take a look at the ./configure output. if you get a message saying something similar to:
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).
try installing bison: sudo apt-get install bison
then make distclean then ./configure ... then make then make -i install
http://www.linuxforums.org/forum/redhat-fedora-linux-help/87975-configuring-php-work-apache.html
As @zecrazytux indicated, did you install the appropriate apache-dev packages? PHP could well have built without them, even though you told it where they were. You need to look at the ./configure output.