Subject: CGI changes for the php4 and php5 packages
To: None <tech-pkg@NetBSD.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 09/04/2005 19:51:53
I've been investigating setting up PHP for use by non-Apache web-servers.
The php4 and php5 packages build and install the PHP CLI and PHP CGI
binaries; however the CGI binary (installed into /usr/pkg/libexec/cgi-bin)
is built with --enable-force-cgi-redirect, which according to the PHP
documentation "relies on Apache to set the non-standard CGI environment
variable REDIRECT_STATUS":

    http://www.php.net/manual/en/security.cgi-bin.force-redirect.php

Also, since we install the PHP CGI binary inside the web tree of files,
we don't need to build it with --enable-discard-path according to this
page:

    http://www.php.net/manual/en/security.cgi-bin.shell.php

Since there are already packages that build and install Apache-specific
versions of PHP (ap-php4 and ap-php5), I think we should change the
PHP packages to *not* configure with:

	--enable-force-cgi-redirect
	--enable-discard-path

We should also build them with FastCGI support (--enable-fastcgi) to
facilitate setting up a usable PHP installation for use with non-Apache
web-servers.  This would also be usable by Apache if a webadmin chooses
to use FastCGI PHP instead of mod_php.

Comments?

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>