在我安装PHP时,出现以下错误,不知道如何解决Security Alert! PHP CGI cannot be accessed directly.

Drate
博客专家认证
2002-04-20 11:31:45
Security Alert! 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. This variable is set, for example, by Apache's Action directive redirect.

You may disable this restriction by recompiling the PHP binary with the --disable-force-cgi-redirect switch. If you do this and you have your PHP CGI binary accessible somewhere in your web tree, people will be able to circumvent .htaccess security by loading files through the PHP parser. A good way around this is to define doc_root in your php.ini file to something other than your top-level DOCUMENT_ROOT. This way you can separate the part of your web space which uses PHP from the normal part using .htaccess security. If you do not have any .htaccess restrictions anywhere on your site you can leave doc_root undefined. If you are running IIS, you may safely set cgi.force_redirect=0 in php.ini.
...全文
443 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Drate 2002-04-20
  • 打赏
  • 举报
回复
我在安装的时候改动了PHP.INI文件
AlexJia2046 2002-04-20
  • 打赏
  • 举报
回复
把force_redirect=0 这句放到php.ini里就可以了
icb 2002-04-20
  • 打赏
  • 举报
回复
CGI那個文件是FASTCGI的PHP解析器接口 你得明白?哈!
cf_journey 2002-04-20
  • 打赏
  • 举报
回复
我也碰到过相同的问题,不过你可以换一种方式嘛。不要使用CGI方式,如果你用的是APACHE的话,请使用模块方式,如果用的是IIS的话,请使用ISAPI方式。我想这可能是PHP的一大改进吧,因为CGI方式相对来说,其安全性不好。

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧