Skip to content

Commit 1a08236

Browse files
author
James Cox
committed
MFH.
1 parent 6c82fcf commit 1a08236

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

sapi/cgi/cgi_main.c

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -480,23 +480,16 @@ int main(int argc, char *argv[])
480480
in case some server does something different than above */
481481
&& (!redirect_status_env || !getenv(redirect_status_env))
482482
) {
483-
PUTS("<b>Security Alert!</b> PHP CGI cannot be accessed directly.\n\
484-
\n\
485-
<P>This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\
483+
PUTS("<b>Security Alert!</b> The PHP CGI cannot be accessed directly.\n\n\
484+
<p>This PHP CGI binary was compiled with force-cgi-redirect enabled. This\n\
486485
means that a page will only be served up if the REDIRECT_STATUS CGI variable is\n\
487-
set. This variable is set, for example, by Apache's Action directive redirect.\n\
488-
<P>You may disable this restriction by recompiling the PHP binary with the\n\
489-
--disable-force-cgi-redirect switch. If you do this and you have your PHP CGI\n\
490-
binary accessible somewhere in your web tree, people will be able to circumvent\n\
491-
.htaccess security by loading files through the PHP parser. A good way around\n\
492-
this is to define doc_root in your php.ini file to something other than your\n\
493-
top-level DOCUMENT_ROOT. This way you can separate the part of your web space\n\n\
494-
which uses PHP from the normal part using .htaccess security. If you do not have\n\
495-
any .htaccess restrictions anywhere on your site you can leave doc_root undefined.\n\n\n\
496-
If you are running IIS, you may safely set cgi.force_redirect=0 in php.ini.\n\
497-
\n");
498-
499-
/* remove that detailed explanation some time */
486+
set, eg via an Apache Action directive.</p>\n\
487+
<p>For more information as to <i>why</i> this behaviour exists, see the <a href=\"http://php.net/security.cgi-bin\">
488+
manual page for cgi security</a>.</p>\n
489+
<p>For more information about changing this behaviour or re-enabling this webserver,\n\
490+
consult the installation file that came with this distribution, or visit \n\
491+
<a href=\"http://php.net/install.windows\">the manual page</a></p>\n");
492+
500493
#ifdef ZTS
501494
tsrm_shutdown();
502495
#endif

0 commit comments

Comments
 (0)