当前位置:首页 > PHP教程 > PHP高级教程

The specified CGI application misbehaved by not returning a complete set of HTTP headers

是错误报告:
the specified cgi application misbehaved by not returning a complete set of http headers
意思是:(http协议的cgi模式运行不正确)

因为perl脚本的第一句中不支持 -wt 参数,将所有的 -wt 替换成 -w 即可
即:将 #!/usr/bin/perl –wt 替换为:将 #!/usr/bin/perl –w
这是代表php是以cgi模试运行的 在php.ini找到 gi.force_redirect 把前面的分号去掉 把值改成0就行了。

再次运行就可以了,这是php另一种运行模式的配置方法

今天遇到的php错误

cgi error
the specified cgi application misbehaved by not returning a complete set of http headers.

最后解决办法是将php的cgi方式改为isapi方式。

环境:windows xp sp3+iis5.1+activeperl 5.10.0
安装bugzilla后,配置cgi,运行后错误如下:

cgi error
the specified cgi application misbehaved by not returning a complete set of http headers. the headers it did return are:

"-t" is on the #! line, it must also be used on the command line at e:bugzilla-3.4.2bugzilla-3.4.2index.cgi line 1.

错误报告:
the specified cgi application misbehaved by not returning a complete set of http headers
意思是:(http协议的cgi模式运行不正确)

因为perl脚本的第一句中不支持 -wt 参数,将所有的 -wt 替换成 -w 即可
即:将 #!/usr/bin/perl –wt 替换为:将 #!/usr/bin/perl –w
这是代表php是以cgi模试运行的 在php.ini找到 gi.force_redirect 把前面的分号去掉 把值改成0就行了。

ps:另外解决办法
修改iis设置里,主目录选项卡->应用程序设置->选择cgi,之后在添加/编辑应用程序扩展映射名:将cgi可执行文件名写为:
d:perlbinperl.exe -x -wt “%s“ %s
(注:这里我的perl安装在d:perl目录里)
这个样子就不需要更改bugzilla的文件了
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!