Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Feb 2006 14:21:24 +0100
From:      Olaf Greve <o.greve@axis.nl>
To:        freebsd-questions@freebsd.org
Subject:   Help! Apache 2.2 gives segmentation fault errors with PHP.
Message-ID:  <43F32AD4.1090103@axis.nl>

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

Alright, after having been stuck with this for an hour or two now, I'm 
going to call upon your infinite wisdom regarding the following:

On a FreeBSD 5.2.1-RELEASE #0 (so says dmesg) machine, I'm trying to 
set-up Subversion, Trac and our regular PHP4 and MySQL stuff.

The main issue is that Apache 2.2 blows up (with a segmentation fault) 
when calling various PHP scripts, which I think is due to a dodgy way of 
having set-up PHP4 under Apache. This message works towards the issue, 
providing relevant(?) details, as I type along:

Here we go:
Previously the machine was running Apache 1.3.34 and that went just 
swell with PHP and all, but apparently for Subversion and/or Trac, 
Apache 2 is desired such that it can be used with WebDav.

No problem so far. I made sure the ports tree was up to date and then 
from the ports I built (always via a 'make' 'make install' sequence, and 
where necessary removing earlier versions as the process went along) 
Apache 2.2, and Subversion.

Upon configuring Apache 2.2 for PHP, however, I'm now running into 
trouble. In order to make PHP4 work under Apache 2.2 I built 
/usr/ports/www/mod_php4 and installed it.

Then I added the following to Apache's httpd.conf file:
[...]
LoadModule php4_module        libexec/apache22/libphp4.so
[...]
<IfModule mime_module>
[...]
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

Also, some other stuff was tweaked in httpd.conf (though very mildly), 
like enabling SSL etc.

Now, upon starting Apache, using 'apachectl start' the following warning 
is printed twice:
[Wed Feb 15 15:12:41 2006] [warn] (2)No such file or directory: Failed 
to enable the 'httpready' Accept Filter

And the /var/log/httpd-error.log file mentions the following (at the end):
[...]
[Wed Feb 15 15:12:38 2006] [notice] caught SIGTERM, shutting down
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:41 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate is a CA 
certificate (BasicConstraints: CA == TRUE !?)
[Wed Feb 15 15:12:42 2006] [warn] RSA server certificate CommonName (CN) 
`Olaf Greve' does NOT match server name!?
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...............
[...]
PHP Warning:  Function registration failed - duplicate name - 
ob_gzhandler in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - 
zlib_get_coding_type in Unknown on line 0
PHP Warning:  zlib:  Unable to register functions, unable to load in 
Unknown on line 0
[Wed Feb 15 15:12:42 2006] [notice] Digest: generating secret for digest 
authentication ...
[Wed Feb 15 15:12:42 2006] [notice] Digest: done
[Wed Feb 15 15:12:43 2006] [notice] Apache/2.2.0 (FreeBSD) mod_ssl/2.2.0 
OpenSSL/0.9.7c DAV/2 PHP/4.4.2 configured -- resuming normal operations


So it starts, but it seems pretty much all PHP extensions are doubly 
declared!
When calling phpinfo, the modules do show up as expected, but as soon as 
one tries to use e.g. the 'header()' function in PHP (or quite a few 
other PHP functions for that matter), nothing seems to happen in the 
browser, and the /var/log/httpd-error.log file mentions the following:
[...]
[Wed Feb 15 15:19:29 2006] [notice] child pid 27728 exit signal 
Segmentation fault (11)

And a similar message is written to /var/log/messages, being:
[...]
Feb 15 15:19:28 aceshuttle kernel: pid 27728 (httpd), uid 80: exited on 
signal 11


I suspect something went wrong in the way I try to use PHP. Basically, I 
first removed the installed /usr/ports/lang/php4 port, then built and 
installed the /usr/ports/www/mod_php4 port, and then added various 
php4-extensions, using the /usr/ports/lang/php4-extensions port (I 
suspect the extensions to cause the problem).

Does anyone know what could be going on and/or how to properly set up 
PHP 4 under Apache 2.2?

Tnx a lot in advance, and cheers!
Olafo



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