[mapserver-users] MapServer Error]: msLoadMap()

harpal singh harpalhira at gmail.com
Tue Sep 15 00:18:37 PDT 2009


I am new to map servers… I have written my first program …..and I am having
problem ……I have written a simple hello world programon windows and it is
showing problems……

Error is ------------------
*Warning*: [MapServer Error]: msLoadMap(): First token must be MAP, this
doesn't look like a mapfile. in *C:\OSGeo4W\apache\htdocs\hello.php* on line
*6*

*Warning*: Failed to open map file C:\OSGeo4W\apache\htdocs/hello.map in *
C:\OSGeo4W\apache\htdocs\hello.php* on line *6*

*Fatal error*: Call to a member function draw() on a non-object in *
C:\OSGeo4W\apache\htdocs\hello.php* on line *8*

I have tried so much but it is not sorted out ….. plz help me in doing so
…….. thanx in advance …





The code is

<?php

 dl("php_mapscript.dll");

 $map_path="C:\OSGeo4W\apache\htdocs/";

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

$image=$map->draw();

 $image_url=$image->saveWebImage();

 ?>

<HTML>

<HEAD>

<TITLE>MAPSERVER HELLO WORLD</TITLE>

</HEAD>

<BODY>

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

</BODY>

</HTML>

 The hello.map file is in the C:\OSGeo4W\apache\htdocs directory ……. And the
hello.php file is also in the same directory.
Plz help me I will be greatful to u
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090915/31dbea55/attachment.htm>


More information about the MapServer-users mailing list