执行header("location:abc.php")出现找不到页面

voyager 2002-10-30 09:20:49
我发现在使用header("location:abc.php")重定向到另一个页面时经常会出现找不到该页面的错误:(如下)
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

这是怎么回事啊,每次都要刷新一下才可以,但在我的开发服务器上却不会有这种情况?
我用的是PHP4.2.1+IIS5+WIN2000

还有,如果把IIS改为APACHE,居然不能保存COOKIE?
...全文
78 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
voyager 2002-11-18
  • 打赏
  • 举报
回复
FT,这是怎么啦,在PHP.net上问也没有人碰到,我到底错在哪?
voyager 2002-10-31
  • 打赏
  • 举报
回复
都没有人碰到过这样的情况吗?
goodname 2002-10-30
  • 打赏
  • 举报
回复
关注...


实在不行,你清掉缓存试试..
voyager 2002-10-30
  • 打赏
  • 举报
回复
我这个问题问的是为何使用header("location:...")语句后会出错找不到页面,而不是怎么解决Security Alert! Th..的错误,上面那位老兄说的解决方法是把cgi.force_redirect = 0,那我原来已经是这样子了,只是realyfly(我爱和平) 说的解决方法是把cgi.force_redirect 设为1才会出现安全警告的问题
phpteam 2002-10-30
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/TopicView1.asp?id=1008822
anziqi 2002-10-30
  • 打赏
  • 举报
回复
cgi.force_redirect = 0
voyager 2002-10-30
  • 打赏
  • 举报
回复
不行啊,因为在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包的
可乐加水 2002-10-30
  • 打赏
  • 举报
回复
把php.ini
里面
; cgi.force_redirect = 1
前面的分号去掉
goodname 2002-10-30
  • 打赏
  • 举报
回复
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

21,886

社区成员

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

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