Saturday, June 6, 2009

[MapServer Error]: msLoadMap(): First token must be MAP, this doesn't look like a mapfile.

In my development machine, I managed to set up mapserver to run on both windows and PUbuntu OS without much problem. On pushing the files to the host, I kept getting this as a first warning followed by another warning PHP Warning: Failed to open map file mapfile.map and then the killer PHP Fatal error: Call to a member function setextent() on a non-object . This was so disturbing since I was using the exact same copy of files both in the development machine and the server, although the sever was running on fedora.

Basically it boils down to this. Depending on the version of mapserver that you are running the map file might not be used on both versions. Some versions of mapsever requires a directive MAP at the beginning and an END at the end of the map file and a SYMBOLSET directive at the begining of a symbol file and a END directive at the end.


These two directives have made my life a living hell for 3 days, so I am posting this to help anybody who might be in the same pool.

4 comments:

  1. I got the same problem recently. Thank you for your help.
    - xavier

    ReplyDelete
  2. Sweet! This just progressed me to the next error message, thanks for posting :)

    ReplyDelete
  3. Excelent!
    That was my problem too ^^

    ReplyDelete
  4. You good sir has just won the internets.

    ReplyDelete