Apache的[cgi:error] Premature end of script headers 错误

Apache的[cgi:error] Premature end of script headers 错误

我修改程序时,误把

printf("Content-type:text/plain;charset=UTF-8\n\n");

放到了其他内容输出的后面一点点。就报这个错误。或者报:

End of script output before headers

因为:

 CGI程序第一行输出的内容必须是: "Content-Type:text/html"这个输出作为HTML的文件头。

如果忘了Content-type也是这个错误。

出现这个错误时,页面返回:

500 Internal Server Error 错误。

猜你喜欢

转载自blog.csdn.net/chengg0769/article/details/128832144