zoukankan      html  css  js  c++  java
  • malformed header from script. Bad header的解决方法

    今天配了CGI服务器,打开CGI报错:
    [Wed Jun 02 13:57:21 2010] [error] [client 192.168.0.1] malformed header from script. Bad header=Hello,World!: index.cgi
    [Wed Jun 02 13:57:21 2010] [error] [client 192.168.0.1] malformed header from script. Bad header=Hello,World!: index.cgi
    [Wed Jun 02 13:57:21 2010] [error] [client 192.168.0.1] malformed header from script. Bad header=Hello,World!: index.cgi
     
        在服务器上用perl支持文件是正确的,权限也有了,后面在网上查到是文件头有问题。CGI文件第一句一定要先定义内型,然后跟着是一个新空行,在下来就是主程序了,由于我在定义内型后没有输出文件头及换行,直接就是主程序,所以一才导致上面出现的错误。
        CGI不执行,APACHE错误日志:Premature end of script headers,或 malformed header from script. Bad headerXXX,这种情况,还是检查一下CGI输出的第一句话是啥。应该是形如:
           Content-type:text/html
           注意:声明好Content-type后要输出两个空行。
  • 相关阅读:
    Qt安装
    Windows下查看进程的工具
    編譯 Boost 1.35.0 (Visual Studio 2005 (VC 8.0) + Windows XP
    boost1.35.0编译日志
    Linux
    Tool
    word cup
    IIS Study
    Oracle PL/SQL语言基础1 [初级] (http://www.cnmpa.com/edu/a1/8/892f4a44496ef382.asp)
    Psychology
  • 原文地址:https://www.cnblogs.com/whowhere/p/10059284.html
Copyright © 2011-2022 走看看