It appears that as of 5.3.0, --enable-force-cgi-redirect is not a valid configure option. A quick review of the 5.3.0 code indicates that it the logic previously enabled by specifying the --enable-force-cgi-redirect configure option is being built into php by default.
ケース 2: cgi.force_redirect を使用
設定ディレクティブ cgi.force_redirect は、 http://my.host/cgi-bin/php/secretdir/script.php のように URL から直接 PHP を呼び出すことを禁止します。 代わりに、 Web サーバーのリダイレクションにより処理された場合は、 PHP はこのモードでのみ処理を行います。 4.2.0 より古いバージョンの PHP では、コンパイル時のオプション --enable-force-cgi-redirect を使えば同じことができます。
通常、Apache 用設定でのリダイレクションは、 次の命令を使用して行います。
Action php-script /cgi-bin/php AddHandler php-script .php
このオプションは、Apache Web サーバーでのみテストされており、リク エストのリダイレクト時に Apache が標準ではないCGI 環境変数 REDIRECT_STATUS をセットすることを前提にしています。 リクエストが直接のものであるか間接のものであるかを示す手段をWeb サーバーが全くサポートしていない場合は、このオプションを使用する ことはできません。この場合、ここで記した CGI 版を実行する他の方法 の内の一つを使用する必要があります。
harvey dot eneman at oracle dot com
30-Jun-2009 10:29
mega-squall at caramail dot com
13-Jan-2008 07:36
Contrary to what was said, you can use arbitrary names for your MIME Type ...
However there's a restriction as it must be a valid MIME Type.
For instance, this is working perfectly :
AddHandler application/x-httpd-php4 .php4
AddHandler application/x-httpd-php5 .php5 .php
AddHandler application/x-httpd-php6 .php6
gelgin at internut dot com
25-Apr-2007 04:08
solaris 9 php4.4.0
i have found you can't use arbitrary names ie.
AddType application/x-httpd-php .php
works
#AddHandler php4-script .php
won't do must be
AddHandler application/x-httpd-php
celtic at sairyx dot org
14-Dec-2006 10:24
Note that force-redirect doesn't work with IIS at all; it'll tell you to go away, as IIS doesn't supply the right variables to PHP.
php.ini tells you to turn it off, so make sure you do.
