[mapserver-users] Can't get PHP to work as a CGI.
Dale Ott
DOtt at PALATINE.IL.US
Fri Jul 5 09:43:35 PDT 2002
Sorry but I will be out of the Office until Monday, July 15, 2002. I will be checking my email periodically while I am gone and as soon as I return and will get back to you then. Sorry for any inconvenience. Thanks!
>>> "mapserver-users at lists.gis.umn.edu" 07/04/02 05:10 >>>
On Wed, Jul 03, 2002 at 11:32:25PM -0500, David L Norris wrote:
> How about something like this:
>
> <VirtualHost 192.168.1.40>
> ServerName map.log.cabin
> ServerAlias map
> DocumentRoot /var/www/html/ben/mapserv_demo/local/
>
> ScriptAlias /cgi-bin/ /var/www/html/ben/mapserv_demo/local/cgi/
> AddType application/x-httpd-php-cgi .pmap
> Action application/x-httpd-php-cgi /cgi-bin/php
> </VirtualHost>
>
> I use a .htaccess file instead of twiddling with the virtual server
> config. This way I can use the standard .php extension and switch from
> mod_php to the CGI where required. I also generally keep my cgi-bin out
> of the web tree and map it with ScriptAlias.
Thanks, David. The above did indeed work.
> > The permissions on the cgi directory are 750 and it's group is apache.
> > When I point my browser to http://map/test.pmap (filesystem url:
> > /var/www/html/ben/mapserv_demo/local/test.pmap), I get a 404 stating
> > that /cgi/php/test.pmap couldn't be found. It appears to me that
> > Apache isn't rewriting the URL or something similar, however I'm not
> > very familiar with Apache configuration.
>
> Do you get a 404 when you request /cgi/php? If so then make sure php
> was installed to your cgi directory. Probably either a config problem
> or a file/directory name problem.
I didn't get a 404, but the binary didn't get executed. Instead,
apache would just serve up the binary as-is...it was pretty ugly. I
created a simple python cgi script in the cgi directory, and it
wouldn't execute it either, so apparently what I had in my httpd.conf
just wasn't telling it to use cgi as a cgi bin. It works with
your config.
Now I can compile Mapserver 3.6.1. The whole reason I'm upgrading
from 3.5, is that a call to processquerytemplate in 3.5 always gives
an undefined function error.
Thanks for your help,
Ben
--
Ben Logan: ben at wblogan dot net
OpenPGP Key KeyID: A1ADD1F0
More information about the MapServer-users
mailing list