Problems building PHP/Mapscript on Redhat Enterprise 4

Joshua Buysse buysse at SOCSCI.UMN.EDU
Thu May 12 12:49:55 EDT 2005


I'm having some trouble getting PHP Mapscript to work correctly on RHEL
4.  I'm using the stock PHP, and some modified versions of the
mappinghacks.com SRPM packages.  I've tried 4.4.2, 4.6.0-beta1 and
4.6.0-beta2.  Some problem with all versions.

With an extremely simple example (hello.phtml from
http://www.mobilegeographics.com/mapserver/), it fails with both the
Apache DSO and the CGI versions of PHP.  Get a segfault from it, and at
a glance, it looks like php3_map_ms_new is passing bogus arguments to
mapObj_new.

I'm not a C programmer typically -- only in emergencies, and I've never
dealt with the PHP API.  Anybody have any ideas what's going on?
Here's the offending PHP code:

<?php
   $map_file="./hello.map";
   $map = ms_newMapObj($map_file);
?>

Here's the GDB output and backtrace:

(gdb) run hello.php
Starting program: /usr/bin/php hello.php
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...[Thread debugging using libthread_db enabled]
[New Thread -1208023360 (LWP 21889)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208023360 (LWP 21889)]
0x01034b29 in msLoadMap (filename=0x927f214 "", new_mappath=0x0) at
mapfile.c:4178
4178      if((msyyin = fopen(filename,"r")) == NULL) {
(gdb) bt
#0  0x01034b29 in msLoadMap (filename=0x927f214 "", new_mappath=0x0) at
mapfile.c:4178
#1  0x0101175f in mapObj_new (filename=0x40080000 <Address 0x40080000
out of bounds>,
     new_path=0x927f214 "") at mapscript_i.c:100
#2  0x010061b6 in php3_ms_map_new (ht=0, return_value=0x927f1d4,
this_ptr=0x0, return_value_used=1)
     at php_mapscript.c:1729
#3  0x0815fdb6 in execute ()
#4  0x0814e909 in zend_execute_scripts ()
#5  0x0812410d in php_execute_script ()
#6  0x08168213 in main ()

Last, here's the configure line used (sorry about the excess -- RPM
adds a few things):
./configure --host=i686-redhat-linux-gnu --build=i686-redhat-linux-gnu
--target=i386-redhat-linux --program-prefix= --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin
--sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include
--libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var
--sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --with-gd --with-gdal=/usr/bin/gdal-config
--with-ogr=/usr/bin/gdal-config --with-postgis=pg_config --with-geos
--with-proj --with-wcs --with-wfs --with-wfsclient --with-wmsclient
--with-curl-config=curl-config --with-php=/usr/include/php
--with-xpm=/usr/X11R6/lib --enable-debug
--with-php-regex-dir=/usr/include/php/regex

Thanks to anyone who's read this far.
--
Josh Buysse, System Administrator
CLA-OIT, Division of Research Computing Services
University of Minnesota

"Democracy should not be for export only."
   -- Jesse Jackson
   http://www.suntimes.com/output/jesse/cst-edt-jesse30.html



More information about the mapserver-users mailing list