Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2006 10:01:47 +0100
From:      Olaf Greve <o.greve@axis.nl>
To:        Olaf Greve <o.greve@axis.nl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Help! Apache 2.2 gives segmentation fault errors with PHP. - Solved! :)
Message-ID:  <43F43F7B.4010900@axis.nl>
In-Reply-To: <43F32AD4.1090103@axis.nl>
References:  <43F32AD4.1090103@axis.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi all,

Yesterday I had trouble when configuring Apache 2.2 with PHP 4.4.2, 
which caused Apache to crash (segmentation fault) when calling various 
PHP functions.

The hint to the answer resided in the /var/log/httpd-error.log file:

> And the /var/log/httpd-error.log file mentions the following (at the end):
> [...]
> PHP Warning:  Function registration failed - duplicate name - bzopen in 
> Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name - bzread in 
> Unknown on line 0
> [...]
> ..............many more similar messages...............

This obviously hinted at these functions (i.e php4-extensions) somehow 
being doubly present and called.

Issuing a 'pkg_info | grep php' command was most illustrative, and 
showed over a screen full of output like this:

mod_php4-4.4.2_1,1  PHP Apache Module
php4-bcmath-4.4.2_1 The bcmath shared extension for php
php4-bz2-4.3.10     The bz2 shared extension for php
php4-bz2-4.4.2_1    The bz2 shared extension for php
php4-calendar-4.4.2_1 The calendar shared extension for php
php4-crack-4.4.2_1  The crack shared extension for php
php4-ctype-4.4.2_1  The ctype shared extension for php
php4-dio-4.4.2_1    The dio shared extension for php
php4-domxml-4.4.2_1 The domxml shared extension for php
php4-exif-4.4.2_1   The exif shared extension for php
php4-extensions-1.0 A "meta-port" to install PHP extensions
php4-gd-4.3.10      The gd shared extension for php
php4-gd-4.4.2_1     The gd shared extension for php
[...more lines where those came from...]

Tadaaaah!! there we go: indeed several extensions were somehow not 
removed properly when a previous upgrade to PHP 4.4.2 (from v4.3.10) was 
performed!

As to the reason for this, go figure, I always install from the ports by 
doing a 'make' 'make deinstall' 'make reinstall' sequence when upgrading...

Anyway, manually removing all PHP extensions using the various 
individual 'make deinstall' sequences (and bluntly pkg_delete for pear). 
Then, I cleanly redid the process for installing mod_php4 and the 
extensions, and now all is working fine!

Tnx for thinking along with me, and beware of this potential pitfall! :)

Cheers!
Olafo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43F43F7B.4010900>