Hints and Tips for Debugging in MapServer

  1. Use shp2img from the commandline to test your map file if possible. It is often much easier to debug problems without the extra complications of the web environment.
  2. Turn on debugging. As of MapServer 5.0 the MAP, and LAYER objects have a DEBUG keyword. If you include a DEBUG keyword in objects giving problems following by a greater than zero number, then various debugging output about the map, layer or class may be generated. See RFC28 for more info.
  3. Some additional debugging can be turned on from GDAL and OGR by setting the CPL_DEBUG environment variable to on. Similarly additional PROJ.4 debug info can be produced by setting PROJ_DEBUG to ON.
  4. The MS_ERRORFILE environment variable can be set to a path (or "stdout" or "stderr") to have all errors handled within MapServer to a logfile or console. This can be helpful, especially for situations where the error is otherwise ignored, or doesn't get all the way back to the client.
  5. For issues with PerlMapScript see: PerlMapScriptDebugging
  6. Double Check the EXTENT values in the mapfile against the known extent of the data being used.
  7. Review known problems and solutions in MapServer Issue Tracker:
  8. Review known errors and solutions in the MapServerErrors topic.

It is important to realize how and when environment variables are passed onto a CGI. For instance, Apache on Windows does not transfer environment variables to a CGI by default. The best thing is to add the environment variable MS_ERRORFILE in httpd.conf instead of adding a Windows system or user environment variable.

Syntax: SetEnv MS_ERRORFILE "stderr" 
Last modified 15 years ago Last modified on Feb 3, 2009, 7:28:21 AM
Note: See TracWiki for help on using the wiki.