#native_company# #native_desc#
#native_cta#

Locating PHP source in cgi-bin

By Arthur Watts
on September 20, 2001

If you have built PHP as an Apache module (NOT as a CGI binary) and want to locate your PHP source (.php, .php3 etc) in the cgi-bin directory of your Apache setup, you need to Alias the directory which will contain the PHP file :

DocumentRoot         "/intranet/admin/www"
ScriptAlias /cgi-bin "/intranet/admin/cgi-bin"
Alias    /php     "/intranet/admin/cgi-bin/php"

This will ensure that anything under <i>/intranet/admin/cgi-bin/php</i> gets passed to the httpd executable, which knows all about mod_php4 and will treat the source appropriately. Anything else under <i>cgi-bin</i> will be treated as a ‘script’, and will not be passed to the httpd executable. It’s a hack, but it’s the only way I can do this, short of rebuilding PHP as a CGI binary.