Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I think I have a misconfiguration in my mapserver that is preventing it from serving up imagery.

In my map file, I have this section:

  PROJECTION
    "init=epsg:4326"
  END

If I leave that section in, I get this error when calling GetMap or even GetCapabilities:

msProcessProjection(): Projection library error. no system list, errno: 2

If I remove that section (not desirable), GetCapabilities works, but GetMap gives this error:

<ServiceExceptionReport version="1.1.1">
    <ServiceException code="InvalidSRS">msWMSLoadGetMapParams(): WMS server error. Cannot set new SRS on a map that doesn&#39;t have any projection set. Please make sure your mapfile has a projection defined at the top level.</ServiceException>
</ServiceExceptionReport>

Which is expected because I just removed the section.

So, my question is how do I debug the error: msProcessProjection(): Projection library error. no system list, errno: 2?

Searching online, I see comments related to permissions, but apache (user running httpd) can access the following directories defined in my httpd.conf:

SetEnv LD_LIBRARY_PATH /some/place/lib/
SetEnv PROJ_LIB /some/place/share/proj/
SetEnv GDAL_DATA /some/place/share/gdal/
SetEnv LC_NUMBERIC C
SetEnv GEOTIFF_CSV /some/place/share/gdal/
SetEnv LANG=C

In /some/place/share/proj, there is a file epsg that is as I expect.

I get no errors from apache.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You can run the mapserv program directly from the command line (use su to switch to the apache user first) - running it through strace should help determine how libraries are being loaded and functions are being called.

You should set your specific environment variables manually before invoking mapserv to properly reflect your Apache configuration.

Also, you can set other enviroment variables to simulate running as a CGI script:

http://www.cgi101.com/book/ch3/text.html

QUERY_STRING is going to be useful.

share|improve this answer
add comment

A couple of thoughts. It is somewhat difficult to diagnose this without looking at your mapfile, but here goes:

  1. You should try setting your PRJJ_LIB variable to PROJ_LIB /some/place/share/proj/nad/ That is where the epsg file should be located.

  2. Enable debugging. Set it to level 5. You will need to set up an error log file too. See more info her in the MapServer docs http://mapserver.org/mapfile/map.html

I am guessing that either the path to the epsg database is wrong or your user doesn't have rights to read it.

I this isn't the problem, I would look at whether you have set all of the layer and map level metadata in your MapFile that is necessary to serve as a WMS server. More info here: http://mapserver.org/ogc/wms_server.html Make sure that you have set a valid SRS/CRS in your WMS metadata.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.