Display a simple map in PHP

Ahmad wokar1 at YAHOO.COM
Fri Feb 18 22:21:10 EST 2005


Hi,

I am simply trying to display a simple map and yet, it doesnt seem to work.
This is the code for my PHP file.

<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 1 ";
$map_path="/var/www/cgi-bin/";
$map_file="tut1.map";
echo " test 2 ";
//$map = ms_newMapObj($map_path.$map_file);
$map = ms_newMapObj($map_path."tut1.map");
//$map = ms_newMapObj("ogr.map");
echo " test 3 ";
$image=$map->draw();
echo " test 4 ";
$image_url=$image->saveWebImage();
echo " test 5 ";
}
?>
<IMG SRC=<?php echo $image_url; ?> >
</body>
</html>


The output is simply:
"MAPSCRIPT LOADED! test 1 test 2 test 3 test 4 "

as if the process crashed or something, the </body></html> are not even
shown, it's like the process is freezing or something, it's very strange.
Can somebody tell me why is this happening?

Thanks for any help.

Ahmad



More information about the mapserver-users mailing list