Re: [phplib] PHP CGI From: Leif Jakob (phplib <email protected>)
Date: 11/30/00

On Wed, Nov 29, 2000 at 11:36:24PM -0600 D. Wade wrote:

> Date: Wed, Nov 29, 2000 at 11:36:24PM -0600
> From: D. Wade <dewy <email protected>>
> To: To phplib <email protected>
> Subject: [phplib] PHP CGI

Hi Donovan!

[..]
> "Security Alert! PHP CGI cannot be accessed directly."
> "This PHP CGI binary was compiled with force-cgi-redirect enabled.
> "This variable is set, for example, by Apache's Action directive

[..]

> Failing Script: test.php
> #!/usr/local/bin/php
> <?php
> phpinfo();
> ?>

[..]

> ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
> <Directory "/usr/local/apache/cgi-bin">
> AllowOverride None
> Options Indexes FollowSymLinks ExecCGI
> Order allow,deny
> Allow from all
> </Directory>

OK: You have 3 ways to excute PHP-code

1. by mod_php
2. by a CGI-Interpreter
3. by the UNIX-Script-Syntax (#!/bin/interpreter)

Only if you use the CGI-Interpreter you should activate
force-cgi-redirect in configure of PHP.

If you don't like the UNIX-Script-Syntax for PHP, you should:

1. place your PHP-interpreter in cgi-bin (the version with force-cgi-redirect)
2. mofify your httpd.conf:

Action php3-script /cgi-bin/php
AddHandler php3-script .php3

Leif

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>