[Mapserver-users] Code of PHP CGI Program Displayed

William Carty admin at thinktankdecoy.com
Sat Feb 15 22:38:09 PST 2003


(Lists Truncated)

Toshimi Minoura wrote:
> Hi All,
> 
> We are trying to make MapServer 3.6.4 work with PHP
> on RedHat Linux 8.0.
> 
> We placed the CGI program php in /var/www/cgi-bin.
> Another CGI program in this directory is correctly executed
> as a CGI program,

Another program using php as cgi, or an actual cgi script?

> We then aded the lines
> 
>    Action phtml-script /cgi-bin/php
>    AddHandler phtml-script .phtml
> 
> to file /etc/httpd/conf.d/php.conf.
> 
> Now, when we select a .phtml file on a browser,
> the binary code of the CGI program php is displayed,
> instead of php interepreting the .phtml script.
> 
> We also tested the following combination
> 
>    AddType application/x-httpd-php-cgi .phtml
>    Action  application/x-httpd-php-cgi /cgi-bin/php
> 
> and got the same result.
> 
> We will appreciate any help.
> 
> Toshi
> 
> P.S. If the answer is posted to mapserver-users, please send
>      me a copy directly. There are too many messages posted
>      on that list each day for me to read.

Personally, I'd highly recommend you drop what you're using now, go grab 
apache & php sources & compile them yourself.  I'm really not sure, as I 
normally roll my own, but the php rpm included with RH8 may not have 
been configured to run php as a cgi.  Again, I'm not sure one way or the 
other, guess it depends upon your answer to the question above.

You may try the following in httpd.conf, this works for me:

<VirtualHost *>
   ServerName gis.ttd.local
   DocumentRoot /usr/local/apache/htdocs/gis
   AddType application/x-httpd-php .phtml
   ScriptAlias /cgi/ "/usr/local/apache/htdocs/gis/cgi/"
   Action php-script /cgi/php
   AddHandler php-script .phtml
</VirtualHost>

Of course, there may be other issues to deal with.  My understanding has 
been that there are some issues between php & apache 2.x.  Can't speak 
to that, as I'm still using apache 1.3.27.

Another thing, what are your permissions on the php binary / symlink?

Good luck.

Will





More information about the MapServer-users mailing list