apache CGI-PHP 错误和重定向问题 Wordpress MU
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/958269/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
CGI-PHP error and Redirection Issue Wordpress MU
提问by user46795
I installed wordpress Mu at http://www.optimalthinking.com/community/wp-admin/install.php
我在http://www.optimalthinking.com/community/wp-admin/install.php安装了 wordpress Mu
But when I visit http://www.optimalthinking.com/community/
但是当我访问http://www.optimalthinking.com/community/
I get
我得到
Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
For more information as to why this behaviour exists, see the manual page for CGI security.
For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.
安全警报!PHP CGI 不能直接访问。
这个 PHP CGI 二进制文件是在启用 force-cgi-redirect 的情况下编译的。这意味着只有在设置了 REDIRECT_STATUS CGI 变量时才会提供页面,例如通过 Apache Action 指令。
有关此行为为何存在的更多信息,请参阅 CGI 安全性手册页。
有关更改此行为或重新启用此 Web 服务器的更多信息,请参阅此发行版附带的安装文件,或访问手册页。
Can anyone tell me what's the problem and how it can be fixed.
谁能告诉我是什么问题以及如何解决。
Things I have tried so far:
到目前为止我尝试过的事情:
- Reinstalled the WPMU
- http://mu.wordpress.org/forums/topic/5529
- http://trac.mu.wordpress.org/ticket/502
- Tried changing .htaccess
- 重新安装 WPMU
- http://mu.wordpress.org/forums/topic/5529
- http://trac.mu.wordpress.org/ticket/502
- 尝试更改 .htaccess
All these things didnt yield any results. If stackoverflow allows me, I would reward anybody who would fix this.
所有这些事情都没有产生任何结果。如果 stackoverflow 允许我,我会奖励任何能解决这个问题的人。
Thanks
谢谢
回答by John Weldon
You need to fix your php.ini
你需要修复你的php.ini
Add/fix this line:
添加/修复此行:
force_cgi_redirect = 0
or, in latest PHP versions:
或者,在最新的 PHP 版本中:
cgi.force_redirect = 0
回答by Nazariy
In my opinion it have something to do with your configuration, for some reasons script trying to redirect user to cgi-bin folder which is private.
在我看来,这与您的配置有关,出于某些原因,脚本试图将用户重定向到私有的 cgi-bin 文件夹。
回答by razzed
From http://us3.php.net/security.cgi-bin
来自http://us3.php.net/security.cgi-bin
PHP CGI with VirtualHosts.
This is what I found out while trying to get php to work as CGI with Apache VirtualHosts.
By enabling 'force-cgiredirects', you *must*:
1) set 'cgi.fix_pathinfo=1' in php.ini
2) leave doc_root commented out (php.ini also)
If you miss item 1, the apache logs will show 'unexpected T_STRING' in the php binary.
If you miss item 2, you'll only see 'No input file specified.', instead of the expected output.
You can then turn on the php support for a particular vhost by defining:
Action php-script /cgi-bin/php
inside the corresponding <VirtualHost> directive.
Cheers.
干杯。

