PHP Doku:: Fall 2: --enable-force-cgi-redirect benutzen - security.cgi-bin.force-redirect.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchSicherheitInstallier als CGI-VersionFall 2: --enable-force-cgi-redirect benutzen

Ein Service von Reinhard Neidl - Webprogrammierung.

Installier als CGI-Version

<<Fall 1: Nur öffentliche Dateien vorhanden

Fall 3: doc_root oder user_dir festlegen>>

Fall 2: --enable-force-cgi-redirect benutzen

Die Konfigurationsdirektive cgi.force_redirect verhindert grundsätzlich den Aufruf von PHP mit einer URL wie http://my.host/cgi-bin/php/secretdir/script.php. Stattdessen parst PHP in diesem Modus nur dann, wenn der Aufruf durch einen korrekten Redirect des Webservers erfolgte. PHP älter als 4.2.0 nutzte stattdessen die --enable-force-cgi-redirect-Kompilierungsoption.n

Normalerweise wird der Redirect in der Apache-Konfiguration mit den folgenden Einträgen festgelegt:

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

Diese Option wurde nur mit dem Apache Webserver getestet und ist abhängig davon, wie Apache die nicht standardmäßige CGI-Umgebungsvariable REDIRECT_STATUS bei Redirect-Anfragen setzt. Sollte Ihr Webserver keine Möglichkeit unterstützen, zu übermitteln, ob es sich um einen direkten Aufruf oder einen Redirect handelt, können Sie diese Option nicht verwenden und müssen einen der anderen hier beschriebenen Wege gehen, die CGI-Version zu nutzen.


4 BenutzerBeiträge:
- Beiträge aktualisieren...
harvey dot eneman at oracle dot com
1.07.2009 1:29
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.
mega-squall at caramail dot com
13.01.2008 23: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
26.04.2007 7: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
15.12.2006 2: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.



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)