简体   繁体   English

Apache 从 Perl CGI 脚本的脚本返回格式错误的 header

[英]Apache returning malformed header from script for Perl CGI script

I am running a perl script on an Apache httpd server and intermittently I get 500 Internal Server Error.我在 Apache httpd 服务器上运行 perl 脚本,间歇性地收到 500 Internal Server Error。

When I check the error log, I see below error:当我检查错误日志时,我看到以下错误:

Mon Feb 22 15:04:25 2021] [error] [client xxx.xxx.xx.xx ] malformed header from script. Bad header=Can I override this?: test.cgi

Can someone please let me know what could have went wrong?有人可以让我知道可能出了什么问题吗?

This first text that a CGI program should print to STDOUT is the CGI headers (which will probably include Content-type: ). CGI 程序应该打印到STDOUT的第一个文本是 CGI 标头(可能包括Content-type: )。

It seems that under some circumstances, your program prints the string "Can I override this?"似乎在某些情况下,您的程序会打印字符串“我可以覆盖这个吗?” before those headers.在那些标题之前。 The web server tries to parse that string as a header, fails and throws an error. web 服务器尝试将该字符串解析为 header,但失败并引发错误。

Look at your code, find out why it is printing that string and either stop it from doing so or ensure that the correct headers are printed first.查看您的代码,找出它打印该字符串的原因,然后阻止它这样做或确保首先打印正确的标题。

Without seeing your code, it's hard to be much more help.如果没有看到您的代码,很难获得更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flask-脚本'app.cgi'中的标头格式错误:标头错误 - Flask - malformed header from script 'app.cgi': Bad header Perl CGI脚本不返回内容 - Perl CGI script not returning content 如何在Apache Web服务器中使用Perl CGI脚本 - How to Perl CGI script in apache web sever 从 Apache cgi-bin Python 脚本返回 JSON 数据 - Returning JSON data from Apache cgi-bin Python script cgi:error pid 1217 客户端 {IP}:55101 来自脚本“master3.py”的格式错误的标头:错误标头:数据库 aangemaakt en succesv - cgi:error pid 1217 client {IP}:55101 malformed header from script 'master3.py': Bad header: Database aangemaakt en succesv 如何通过脚本'index.php'修复Apache格式错误的标头:错误的标头:在Laravel 5.6中注册 - How To Fix Apache malformed header from script 'index.php': Bad header: Register In Laravel 5.6 如何重用Perl中在另一个脚本中定义的功能,在Apache下以cgi的身份运行? - How to reuse the functions defined in one script from another in Perl, running as cgi under Apache? 无法让Apache执行Perl CGI脚本 - Can't get apache to execute perl CGI script Perl的CGI脚本和Apache的大小或配置限制 - Size or configuration limitation with perl's cgi script and apache Docker httpd apache 并让 cgi-bin 执行 perl 脚本 - Docker httpd apache and getting cgi-bin to execute perl script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM