Apache, PHP 4.3.9 (dso), MapServer 4.4.1 and Sigfaults

JP Fiset mapserver at FISET.CA
Mon Jan 24 13:04:39 EST 2005


I have been running into a segmentation fault using mapserver and set out
looking for the reason. This message is to report my finding since a number
of you seem to be tackling similar issues.

To understand this message, you should get familiar with the MapServer bug
#252. (http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=252)

Symptom: We had compiled Apache 1.3.33, PHP 4.3.9 and MapServer 4.4.0. PHP
mapscript seemed to work, but the mapserver CGI program was not able to
produce any maps, instead providing the user with a segmentation fault.
(Platform is Linux RedHat 9)

Solution: I suspected that something was not compiled right (going out on a
limb here...) and reviewed the Wiki
(http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?LinuxBuild)

What has changed lately is that PHP's configure script is no longer
accepting the option '--with-system-regex'. And as explained in bug #252,
'--with-regex=system' does not provide the appropriate configuration.

Therefore, I reverted to a less than ideal solution: I modified the PHP
configure script. With the modifications I made, '--with-regex=system'
behaves correctly for compiling mapserver with php_mapscript, when PHP is
installed as a DSO. Here are the changes to PHP's configure file:

78193,78195c78193,78195
<       if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"
|| test "$PHP_SAPI" = "apache2handler"; then
<         REGEX_TYPE=php
<       else
---
>       if test "$PHP_SAPI" = "apache" || test "$PHP_SAPI" = "apache2filter"
|| test "$PHP_SAPI" = "apache2handler"; then
>         REGEX_TYPE=system
>       else

Obviously, this is for PHP 4.3.9, and since the configure script is changed
for every version of PHP (generated), the line numbers might not match your
particular version.

By default, the configure script ignores the '--with-regex=xxx' option when
'--with-apxs=xxx' is used. The change above ignores this check.

With the above change, the instructions found in the Wiki page
(http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?LinuxBuild) can be followed as
they are, with one exception: when configuring PHP, use
'--with-regex=system' instead of '--with-system-regex'



More information about the mapserver-users mailing list