免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2788 | 回复: 3
打印 上一主题 下一主题

[Web] Apache处理header信息错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-10-12 11:02 |只看该作者 |倒序浏览
程序执行后页面显示“Internal Server Error”这样的错误信息。
我查看apache的错误日志里面记录的是
malformed header from script. Bad header=\x1f\x8b\b: /var/eyou/apache/cgi-bin/admin/rmuser

rmuser这个程序在别的服务器上执行都没有任何问题。请问是apache服务器的配置问题,还是程序的问题?

论坛徽章:
5
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:53:172015亚冠之水原三星
日期:2015-06-02 16:34:202015年亚冠纪念徽章
日期:2015-10-19 18:13:37程序设计版块每日发帖之星
日期:2015-11-08 06:20:00
2 [报告]
发表于 2007-10-12 12:37 |只看该作者
这年头还有用 C CGI的么

论坛徽章:
0
3 [报告]
发表于 2007-10-18 12:47 |只看该作者
Object Headers


What does the "malformed header from script" error mean, and how can I
get rid of it?


This is the most frequent error new CGI programmers encounter.
It usually arises when the programmer writes a script that
returns some HTML when called -- in other words, a script that
generates a Web page on the fly.


"Header" refers to the HTTP object header lines in a server's
response to a client's request. The server sends several lines
of "metainformation" describing the content that will follow, a
blank line, and then the requested object. As with news and
mail, the header and the body are always separated by a blank
line.


CGI scripts that wish to return information to clients are
required to:

1. send a header line, Content-type:, describing with a MIME
Content-type the object that will follow (for instance, if
the script wanted to return HTML, this header would read,
"Content-type: text/html");
2. a blank line; and
3. the desired content.



A Perl script that generated HTML, then, would use the
following line to declare its Content-type:

print "Content-type: text/html\n\n";


The Content-type declaration must always be the first line sent
to standard output, if the script intends to return any
information to the client.

论坛徽章:
0
4 [报告]
发表于 2007-10-18 12:50 |只看该作者
A Perl script that generated HTML, then, would use the
following line to declare its Content-type:

print "Content-type: text/html\n\n";

在#! /usr/bin/perl行下
加上print "Content-type: text/html\n\n";
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP