PHPBuilder - Locating PHP source in cgi-bin



RSS Twitter
Tips Setup And Installation

Locating PHP source in cgi-bin

by: Arthur Watts
|
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.

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Arthur Watts

Comment:



Comment:

(Maximum characters: 1200). You have characters left.