[mapserver-users] Build Errors; Currently "msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look like a mapfile. "

Smith, Michael ERDC-CRREL-NH michael.smith at usace.army.mil
Wed Nov 18 22:32:34 EST 2009


Richard,

Add a new line to the beginning of your mapfile of just the word MAP.

Eg 
MAP
NAME "Hello_World"
SIZE 400 300
IMAGECOLOR 249 245 186
IMAGETYPE png
EXTENT -1.00 -1.00 1.00 1.00

Its part of some security changes in the latest version of Mapserver. You
also need to add a SYMBOLSET to the top of symbol files and a new magic
token to templates

See here
http://mapserver.org/development/rfc/ms-rfc-56.html
For more info

Mike


-- 
Michael Smith
RSGIS Center
US Army Corps of Engineers




On 11/18/09 11:06 PM, "Richard Marsden" <winwaed at gmail.com> wrote:

> Hello,
> 
> I have been using MapServer for about 18 months to serve the base maps for
> EcoMapCostaRica.com, and more recently, equal-area-maps.com
> <http://equal-area-maps.com> .
> Originally, I had a lot of trouble building it for the FreeBSD environment
> used by my web host (Pair Networks), but a fellow user (Jason Birch) was able
> to help. I believe this was MapServer 5.2, but could be wrong.
> 
> In the past week, Pair upgraded the version of FreeBSD/etc on my server, and
> not-unexpectedly this broke MapServer.
> I've had more success than last time, and I've managed to re-build MapServer.
> My build was based on Jason's original instructions, but library & MapServer
> versions were bumped to their latest (5.4.2 for MapServer). I also configured
> GDAL to use the internal implementations of libtiff and GeoTIFF, and I skipped
> PHP  (I don't use PHP MapScript).
> 
> Although it built, the two map applications (both based on OpenLayers) are
> displaying white tiles instead of their correct MapServer-rendered maps. I've
> tried a few things, including trying to use 24 bit AGG-derived images
> (interestingly this results in slower display, implying that some of
> MapServer's rendering is working? just it isn't displaying anything?).
> 
> I wasn't making much progress getting these completed applications to work, so
> I thought I would go 'back to basics' and try to get a simple Hello World to
> work. I've just re-entered the Hello World from Bill Kropla's "Beginning
> MapServer" book. The resulting hello.map and hello.html are included below.
> Needless to say, these are not working. I am getting the strange error of:
> 
> msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look
> like a mapfile. 
> 
> What is wrong? I can't see anything wrong in my MAP file, unless something
> fundamental has changed in the past couple of versions?  Inserting a new line
> at the beginning with a "MAP" simply results in a parsing error on line 1!
> Is there something to look for in my build process?  I can post the MapServer
> config if that will help.
> 
> Here is my Hello World HTML:  ( http://www.winwaed.com/playpen/hello.html )
> 
> <html>
> <head><title>MapServer Hello World</title></head>
> <body>
> <form method="POST" action="/playpen/mapserv.cgi">
>   <input type="submit" value="Click Me">
>   <input type="hidden" name="MAP" value="/myhomedir/playpen/hello.map">
>   <input type="hidden" name="map_web_imagepath"
> value="/myhomedir/playpen/tmp/">
> </form>
> <img src="[img]" width=400 height=300 border=0>
> </body>
> </html>
> 
> 
> And here is my hello.map file:  ( /playpen/hello.map )
> 
> NAME "Hello_World"
> SIZE 400 300
> IMAGECOLOR 249 245 186
> IMAGETYPE png
> EXTENT -1.00 -1.00 1.00 1.00
> WEB
>   TEMPLATE "/myhomedir/playpen/hello.html"
>   IMAGEPATH "/myhomedir/playpen/tmp/"
>   IMAGEURL "/playpen/tmp/"
> END
> LAYER
>   STATUS default
>   TYPE point
>   FEATURE
>      POINTS 0.0 0.0 END
>      TEXT "Hello World"
>   END
>   CLASS
>      STYLE
>         COLOR 255 0 0
>      END
>      LABEL
>         TYPE bitmap
>      END
>   END
> END
> END
> 
> 
> 
> Fundamentally I am trying to get MapServer working on a Pair server
> installation (FreeBSD, etc), serving WMS tiles to OpenLayers "MapServer" layer
> objects. Source data are Shape files and GeoTIFF tiles. Image delivery is
> currently in the form of PNG, which is preferred over JPEG (too lossy) and GIF
> (okay for the shapefiles, but not the GeoTIFF-derived imagery).
> 
> 
> Hopefully someone has some clues as to what is wrong with the Hello World?
> If I can get this to work, it should give me some clues (or even fix) the main
> problems I'm having with my applications.
> 
> 
> Cheers,
> 
> Richard Marsden
> http://www.winwaed.com
> 
> 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091118/6fe33a47/attachment.html


More information about the mapserver-users mailing list