I would like to run a PHP script I found to generate some pages for my website.  At 
present, the site is hosted on thttpd.  Looking through dselect, there seem to be two 
implementations of PHP packaged: an Apache module, and php4-cgi which doesn't require 
Apache.  So I installed php4-cgi, and then opened up index.php from the script.  All 
that happened was that Mozilla displayed the contents of that file.

Further investigation revealed the solution to two problems: 
1.  thttpd was set up by default not to run cgi scripts except in cgi-bin.  I changed 
this to include the directory in which my script was located.   I proved that the 
directory permissions were now ok by running a perl cgi script in that location.  
2.  I also turned off cgi-force-redirect in php.ini, which seems to be deisgned for 
use with Apache.  
But despite making these changes, index.php still loads as a text file.

Looking at the thttpd website, I see that it is possible to run it with PHP, but 
there's no description of how to do so.  I've also found various instructions on the 
web for compiling thttpd with php as a module.  But I would prefer to use the standard 
packages with modified config files, rather than compile from scratch.

Has anyone successfully set up PHP to run with thttpd, using the Debian packages?  How 
about using PHP with another non-Apache webserver?  

I have never used PHP before, so I may be making some very obvious mistake.  My system 
runs Debian testing (Sarge).

Please keep me CC'd, as I am not a subscriber to this mailing list.  Thanks for your 
help.

Marc Grégoire

Reply via email to