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

yipeiwu_com5年前PHP代码库
是错误报告:
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的文件了

相关文章

PHP实现求解最长公共子串问题的方法

本文实例讲述了PHP实现求解最长公共子串问题的方法。分享给大家供大家参考,具体如下: 题目:如果字符串一的所有字符按其在字符串中的顺序出现在另外一个字符串二中,则字符串一称之为字符串二的...

PHP获取文件后缀名的三个函数

选好一种记住,以后需要使用的时候就可以直接使用,或者来本站查看本文也是可以滴。 复制代码 代码如下: <?php //方法一: function extend_1($file_na...

PHP语言中global和$GLOBALS[]的分析 之二

还是借用上一篇的例子: PHP代码 复制代码 代码如下: <?php // 例子1 function test_global() { global $var1, $var2; $v...

PHP CURL post数据报错 failed creating formpost data

在做微信卡券使用curl上传logo图片时,发现一个报错: failed creating formpost data 代码中数组如下: $data = array('buffer...

php 代码优化的42条建议 推荐

1.如果一个方法可静态化,就对它做静态声明。速率可提升至4倍。 2.echo 比 print 快。 3.使用echo的多重参数(译注:指用逗号而不是句点)代替字符串连接。 4.在执行fo...