malformed header from script. Bad header的解决方法

今天配置perl服务器出现如下错误:

Internal Server Error

The server encountered an internal error ormisconfiguration and was unable to completeyour request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred,and anything you might have done that may havecaused the error.

More information about this error may be availablein the server error log.


根据错误提示,打开apache错误日志,有如下提示:

[Thu Sep 15 10:18:48 2011] [error] [client 127.0.0.1] malformed header from script. Bad header=hello perl world,this is my fi: myfirst.pl
[Thu Sep 15 10:18:49 2011] [error] [client 127.0.0.1] malformed header from script. Bad header=hello perl world,this is my fi: myfirst.pl
[Thu Sep 15 10:18:56 2011] [error] [client 127.0.0.1] malformed header from script. Bad header=hello perl world,this is my fi: myfirst.pl

根据提示说明有header有问题,查看文件输出的第一句话是什么,应该类似于如下

Content-type: text/plain; charset=iso-8859-1\n\n

你可能感兴趣的:(【perl】)