[mapserver-users] PHPMapscript, Ming & Segmentation fault.

Alan Boudreault aboudreault at mapgears.com
Wed Sep 8 14:24:25 EDT 2010


Hi,

I'd say that php mapscript is not the cause. Could you try to display your map 
using the CGI directly. If you get the same seg fault error, it would be good 
if you could create a ticket with a minimal test case with a mapfile and data 
(perhaps you could do a simple ogr2gr from postgis to shapefile).

regards,
Alan

On September 8, 2010 03:14:22 am Joseph Mamuchishvili wrote:
> Hello,
> 
> I have compiled MapServer 5.6.4 with PHPMapscript on FreeBSD 8.1.
> During configuration Ming support was added.
> phpinfo() returns the following:
> MapScriptMapServer VersionMapServer version 5.6.4 OUTPUT=GIF OUTPUT=PNG
> OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
> SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WFS_SERVER
> SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=OGR
> INPUT=SHAPEFILEPHP MapScript Version
> ($Revision: 10204 $ $Date: 2010-06-02 06:57:48 -0700 (Wed, 02 Jun 2010) $)
> 
> mingMing SWF output libraryenabledVersion0.4.3
> I am using the following php script (*testmap.php*):
> 
> <?php
> $map = ms_newMapObj("/map/apache/htdocs/map/mapsql.map");
> $image=$map->draw();
> $image_url=$image->saveImage("\\tmp");
> ?>
> 
> <HTML>
> 
> <HEAD>
> <TITLE>Example 1: Displaying a map</TITLE>
> </HEAD>
> 
> <BODY>
>     <br>
>     <IMG SRC=<?php echo $image_url; ?> >
> </BODY>
> 
> </HTML>
> 
> and the contents for *mapsql.map* file is:
> 
> MAP NAME "Europe in purple"
> 
>     SIZE 400 400
>     STATUS ON
> EXTENT 478895 4615055 485900 4620056
> 
>     UNITS METERS
>     SHAPEPATH "/home/map/SHP"
> 
> WEB
>         IMAGEPATH "/map/apache/htdocs/tmp/"
>         IMAGEURL "/tmp/"
>         METADATA
>            "wms_title"     "wms_title"  ##required
>            "wms_onlineresource" "
> http://soso.freebsd.host/cg-bin/mapserv?map=/map/apache/htdocs/mapsql.map&"
>            "wms_srs" "EPSG:32638"
>         END
>     END
> PROJECTION
> "proj=utm"
> "zone=38"
> "ellps=WGS84"
> "datum=WGS84"
> "units=m"
> "no_defs"
> END
> 
> QUERYMAP
> COLOR 0 0 255
> STATUS ON
> STYLE HILITE
> END
> 
> 
> LAYER
>         NAME "main_streets"
>  TOLERANCE 1
> TOLERANCEUNITS meters
>         CONNECTIONTYPE postgis
>         CONNECTION "user=pgsql dbname=pgsql host=soso.freebsd.host"
> TEMPLATE "../query/query_template.html"
>         METADATA
>    QUERYABLE "true"
>    fields 'quca_ge:ქუჩის დასახელება,gid:გიდი'
>    hyperlink 'quca|http://myurl.com'
>    searchfield "quca"
>       RESULT_FIELDS  "quca_ge"
>       RESULT_HEADERS "the_geom"
>         END
>         TYPE POLYGON
>         STATUS ON
> DATA "the_geom from main_streets"
>         CLASS
>             STYLE
>                 COLOR 110 50 100
>                 OUTLINECOLOR 200 200 200
>             END
>         END
>     END
> 
> END
> 
> *Everything works fine*, but now *i want to generate flash output*. So I
> added  the following block to *mapsql.map *file:
> 
> OUTPUTFORMAT
>   NAME swf
>   DRIVER "SWF"
>   MIMETYPE "application/x-shockwave-flash"
>   EXTENSION "swf"
>   IMAGEMODE PC256
>   FORMATOPTION "OUTPUT_MOVIE=SINGLE"
> END
> 
> flash output is not generated and the following is appeared in apache error
> log: *Segmentation fault (11).*
> When trying to *launch *the testmap.php script from* the shell* the
> following happens:
> /php/bin/php ./testmap.php
> *newSFWBitmapFillStyle: not a valid Bitmap FillStyle: 0*
> Segmentation fault (core dumped)
> 
> What is the reason of this ? What am I doing wrong ?
> 
> Any suggestions or help will be appreciated.
> 
> Joseph.
> *
> *
> 

-- 
Alan Boudreault
Mapgears
http://www.mapgears.com


More information about the mapserver-users mailing list