[ previous ] [ next ] [ threads ]
 
 From:  Manuel Kasper <mk at neon1 dot net>
 To:  "Mike Maltese" <mike at pcmedx dot com>
 Cc:  <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Re: [m0n0wall] thttpd patch to run PHP cgi binary
 Date:  Sun, 30 Nov 2003 22:57:55 +0100
On 30.11.2003, at 21:45, Mike Maltese wrote:

> I was wondering if anyone has a working patch for thttpd that allows 
> you to
> run the PHP cgi binary. I found one at
> http://www.galaxen.se/~mattias/temp/thttpd-sapi-getenv.patch, but it 
> doesn't
> seem to work with 2.24 in the ports tree.

Here's my patch to mini_httpd-1.17beta1 as used in m0n0wall (AFAIR 
somebody requested this a few days ago, too, but I forgot about it). It 
comments out a few uninteresting (in the m0n0wall environment) 
warnings, adds index.php to the list of default filenames, does not set 
TCP_NOPUSH (because it gave me huge performance problems with SSL) and 
- of course - sets up SCRIPT_FILENAME so the PHP CGI will work. If you 
make

#!/path/to/php -f

the first line of all your .php files and also make them executable, 
you'll be able to access them directly as you would with Apache. Don't 
forget to invoke mini_httpd with -c "**.php".

HTH,

Manuel