502 Bad Gateway The CGI was not CGI/1.1 compliant

来源:互联网 发布:西门子300编程手册 编辑:程序博客网 时间:2024/06/05 08:51

cgi程序进行交互时,浏览器端出现了如下的错误信息:

502 Bad Gateway  

The CGI was not CGI/1.1 compliant

在终端上还会显示这样的提示信息:

cgi_header:unable to find LFIF

这样的错误一般是格式的问题,我写的头是

printf("Content-type: text/html");

正确的应该是:

printf("Content- type: text/html\n\n");

也就是后面有两个空行,这也是默认的格式,必须这样写才行,一定要注意哦。

原创粉丝点击