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

2015-01-24信息快讯网

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 CwT 替换为:将 #!/usr/bin/perl Cw
这是代表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 CwT 替换为:将 #!/usr/bin/perl Cw
这是代表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插入中文到sqlserver 2008里出现乱码的解决办法分享
UCenter 批量添加用户的php代码
ThinkPHP 连接Oracle数据库的详细教程[全]
PHP中使用unset销毁变量并内存释放问题
PHP连接SQLServer2005的实现方法(附ntwdblib.dll下载)
php.ini-dist 和 php.ini-recommended 的区别介绍(方便开发与安全的朋友)
apache+codeigniter 通过.htcaccess做动态二级域名解析
PHP sprintf() 函数的应用(定义和用法)
PHP连接SQLSERVER 注意事项(附dll文件下载)
深入了解 register_globals (附register_globals=off 网站打不开的解决方法)
PHP Warning: PHP Startup: Unable to load dynamic library \ D:/php5/ext/php_mysqli.dll\
php安全之直接用$获取值而不$_GET 字符转义
PHP fgetcsv 定义和用法(附windows与linux下兼容问题)
PHP中return 和 exit 、break和contiue 区别与用法
MySQL的FIND_IN_SET函数使用方法分享
PHP中register_globals参数为OFF和ON的区别(register_globals 使用详解)
PHP函数spl_autoload_register()用法和__autoload()介绍
Trying to clone an uncloneable object of class Imagic的解决方法
PHP spl_autoload_register实现自动加载研究
php curl 登录163邮箱并抓取邮箱好友列表的代码(经测试)
PHP stream_context_create()作用和用法分析
php中突破基于HTTP_REFERER的防盗链措施(stream_context_create)
php expects parameter 1 to be resource, array given 错误
windows下开发并编译PHP扩展的方法
在MongoDB中模拟Auto Increment的php代码
php SQL Injection with MySQL
PHP下通过file_get_contents的代理使用方法
php批量缩放图片的代码[ini参数控制]
php提交表单时判断 if($_POST[submit])与 if(isset($_POST[submit])) 的区别
延长phpmyadmin登录时间的方法
php5 apache 2.2 webservice 创建与配置(java)
PHP Session_Regenerate_ID函数双释放内存破坏漏洞
PHP中删除变量时unset()和null的区别分析
完美实现GIF动画缩略图的php代码
php下尝试使用GraphicsMagick的缩略图功能
window+nginx+php环境配置 附配置搭配说明
Wordpress 相册插件 NextGEN-Gallery 添加目录将中文转为拼音的解决办法
php iconv() : Detected an illegal character in input string
php set_magic_quotes_runtime() 函数过时解决方法
©2014-2024 dbsqp.com