int php.ini
-------------
; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; cgi.force_redirect = 1

解决方案 »

  1.   

    把php.ini
    里面
    ; cgi.force_redirect = 1
    前面的分号去掉
      

  2.   

    不行啊,因为在IIS下,如果把这个选项打开,就会出现安全警告,如下:
    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.INI里有这么一句:
    ; **You CAN safely turn this off for IIS, in fact, you MUST.**不知道我是错在哪里?
    对了,我的PHP是有用zend_optimizer包的
      

  3.   

    http://expert.csdn.net/Expert/TopicView1.asp?id=1008822
      

  4.   

    我这个问题问的是为何使用header("location:...")语句后会出错找不到页面,而不是怎么解决Security Alert! Th..的错误,上面那位老兄说的解决方法是把cgi.force_redirect = 0,那我原来已经是这样子了,只是realyfly(我爱和平) 说的解决方法是把cgi.force_redirect 设为1才会出现安全警告的问题
      

  5.   

    FT,这是怎么啦,在PHP.net上问也没有人碰到,我到底错在哪?