MapScript constantly crashing

Ahmad wokar1 at YAHOO.COM
Tue Feb 22 14:18:09 EST 2005


Hi,

I keep getting this problem with MapScript/PHP. When I call:

http://132.205.108.60/cgi-bin/mapserv?map=tut2.map&mode=map

It works fine, it's just a hello world map file.

When I call:

http://132.205.108.60/mapscript.php

I just displays:
"MAPSCRIPT LOADED! test 0 test 1 test 2 test 3 test 4" and it simply
crashes. This is very very strange and would like any help or hint on why
is MapScript behaving this way. My files are so simply, yet nothing
works... I'd appreciate if someone can tell me what's wrong with what I am
doing.

This is the contents of tut2.map (Hello World map):

MAP
 NAME HELLO
 STATUS ON
 EXTENT 0 0 4000 3000
 SIZE 400 300
 IMAGECOLOR 200 255 255
 WEB
  IMAGEPATH "/var/www/html/tmp/"
  IMAGEURL "/tmp/"
 END


 LAYER
  NAME "credits"
  STATUS DEFAULT
  TRANSFORM FALSE
  TYPE ANNOTATION
  FEATURE
   POINTS
    200 150
   END
   TEXT 'Hello world.  Mapserver rocks.'
  END
  CLASS
   LABEL
    TYPE BITMAP
    COLOR 0 0 0
   END
  END
 END


END



And this is the contents of mapscript.php (to display the tut2.map):

<html>
<head>
<title>hey you...</title>
</head>

<body>
<?
if (!extension_loaded('php_mapscript')) {
   if (dl('php_mapscript.so')) {
      echo " MAPSCRIPT LOADED! ";
   }
   else {
     echo " MAPSCRIPT NOT LOADED! ";
   }



echo " test 0 ";
ms_ResetErrorList();

echo " test 1 ";
$map_path="/var/www/cgi-bin/";
$map_file="tut1.map";
echo " test 2 ";

$map = ms_newMapObj($map_path."tut2.map");

echo " test 3 ";

  $error = ms_GetErrorObj();
  while($error AND $error->code != MS_NOERR) {
    printf("Error in %s: %s<br>\n", $error->routine, $error->message);
    $error = $error->next();
  }


$image=$map->draw();


  $error = ms_GetErrorObj();
  while($error AND $error->code != MS_NOERR) {
    printf("Error in %s: %s<br>\n", $error->routine, $error->message);
    $error = $error->next();
  }


echo " test 4 ";


  $error = ms_GetErrorObj();
  while($error AND $error->code != MS_NOERR) {
    printf("Error in %s: %s<br>\n", $error->routine, $error->message);
    $error = $error->next();
  }


$image_url=$image->saveWebImage();


  $error = ms_GetErrorObj();
  while($error AND $error->code != MS_NOERR) {
    printf("Error in %s: %s<br>\n", $error->routine, $error->message);
    $error = $error->next();
  }



echo " test 5 ";




}

?>

<IMG SRC=<?php echo $image_url; ?> >

</body>

</html>


Please help!!! Thanks.

Ahmad



More information about the mapserver-users mailing list