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

yipeiwu_com6年前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 echo "今天:".date("Y-m-d")."<br&g...

php取出数组单个值的方法

1.数组arr var_dump(arr) 值如下: array (size=3) 'delete' => array (size=3) 0 => strin...

php获取本地图片文件并生成xml文件输出具体思路

复制代码 代码如下: <?php $dir="upload/"; $dir_res=opendir($dir); $fileFormat=array(0=>".jpg",1=...

使用PHP遍历文件目录与清除目录中文件的实现详解

今天无聊中练习了一下PHP遍历文件目录的程序,编写了以下两个程序,不过质量不是很好,轻拍~~~1、清除PHP缓存文件复制代码 代码如下:<?php  function r...

phpexcel导出excel的颜色和网页中的颜色显示不一致

关于phpexcel导出颜色的一些问题,用phpexcel做导出的excel的颜色怎么和网页中的颜色显示不一致呢?想要知道到底是怎么回事?应该如何来解决呢?PHP代码细节如下: PHP...