segmentation fault with a php mapscript layer

Phillip Neal pneal at MBL.EDU
Mon Jul 25 07:44:35 EDT 2005


Dear All,

I have a simple dataset and php program that draws the basic map quite well. But as soon
as I try to create a new 'layer' object , I get a ' segmentation fault ' message.

Here is the code:

<?php

dl('php_mapscript.so');

$map_path="/var/www/html/ms/map_files/";
$map_path="/var/www/docs/mapserver_demos/howto/";
$map_file="europe.map";

$map = ms_newMapObj($map_path.$map_file);

//$layer = ms_newLayerObj($map);
//$layer->set("name", "points");
//$layer->set("type", MS_LAYER_POINT);
//$layer->set("status", MS_DEFAULT);


$image=$map->draw();
$image_url=$image->saveWebImage(MS_PNG,1,1,0);

?>
<HTML>
<HEAD>
<TITLE>Map 2</TITLE>
</HEAD>
<BODY>
<CENTER>
                <img src= "<?php echo $image_url?>">
</CENTER>
</BODY>
</HTML>

I am running

Linux microscope2.mbl.edu 2.6.9-1.667 #1 Tue Nov 2 14:41:25 EST 2004 i686 i686 i386 GNU/
Linux

And my mapserver is

MapServer version 4.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=PDF
SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
INPUT=EPPL7 INPUT=GDAL INPUT=SHAPEFILE

And I am using the mapscript so from that distribution.

I am running php version 4.4 configured like:

./configure     --with-gd=/usr/local    --with-jpeg-dir=/usr/lib    --with-png-d
ir=/usr/lib    --with-tiff-dir=/usr/lib    --with-zlib-dir=/usr/lib    --with-fr
eetype-dir    --without-ttf    --with-mysql=/usr/local/mysql     --enable-dbase
   --enable-dbx    -with-apxs2=/usr/local/apache2/bin/apxs --prefix=/usr/local/p
hp --with-mysqli=/usr/local/mysql



Any suggestions ?

Phil



More information about the mapserver-users mailing list