当前位置: 移动技术网 > IT编程>开发语言>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

2019年04月23日  | 移动技术网IT编程  | 我要评论
是错误报告:
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.2\bugzilla-3.4.2\index.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:\perl\bin\perl.exe -x -wt “%s“ %s
(注:这里我的perl安装在d:\perl目录里)
这个样子就不需要更改bugzilla的文件了

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网