PHP 5.3.1 Undefined Symbol: OnUpdateLong error on Apache Startup

Solution 1:

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:

  1. make distclean on the php source
  2. ./configure --prefix=/usr/local/php-5.3-svn --with-apxs2=/usr/bin/apxs2
  3. 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 ;-)

Solution 2:

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.

Solution 3:

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.list

Solution 4:

for 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