[mapserver-users] MapServier and OpenLayers - with PHP?

Christopher Schmidt crschmidt at metacarta.com
Fri Apr 18 12:57:56 PDT 2008


On Fri, Apr 18, 2008 at 02:45:12PM -0500, Richard Marsden wrote:
> This looks simple enough, except for the MapScript URL! Where does it 
> get the map file from?

1. '/wms/vmap0' doesn't use Mapscript, it uses MapServer as a CGI.
2. That path is a minimal CGI: it looks like:

{{{

#!/bin/sh
export MS_MAPFILE=/www/labs/map/vmap0.map
exec /usr/lib/cgi-bin/mapserv

}}}

There's nothing hidden here, it just makes the URL prettier. You can
equally do:

http://localhost/cgi-bin/mapserv?map=/www/labs/map/vmap0.map 

instead.

> How would I get this to work with PHP, considering I can't get  CGI to work?

I would suggest that getting CGI to work is likely to be a better path
than trying to write a WMS request handler in PHP. Perhaps you should
expand on why it doesn't work: you mentioned not being able to restart
Apache: is that something that a web host could help you resolve? Does
your web host allow you to run CGI executables? 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the MapServer-users mailing list