嵌入式boa服务器:502 Bad Gateway The CGI was not CGI/1.1 compliant.

在嵌入式 boa 服务器移植过程中遇到502 Bad Gateway错误,提示CGI不兼容CGI/1.1。错误源于cgi_header.c中的buf为空,可能原因是CGI程序未正确写入管道文件或管道读取失败。已尝试分析代码和检查权限,但问题仍未解决。寻求解决方案。
摘要由CSDN通过智能技术生成

 嵌入式boa服务器:502 Bad Gateway The CGI was not CGI/1.1 compliant.

          这段时间做boa嵌入式服务器移植,一直出现这个错误排除不了。

一、问题: 

      网页显示:

         502 Bad Gateway

                 The CGI was not CGI/1.1 compliant.

        终端错误输出为:

       [18/Mar/2012:00:46:02 +0000] cgi_header: unable to find LFLF

      cgi程序文件内容如下test_cgi.c:

#include <stdio.h>
int main(void)
{
	printf("Content-type: text/html;charset=gb2312\n\n");
	printf("\r\n");
	printf("<html>\n");
	printf("<body>\n");
		printf("123456789\n");
	printf("</body>\n");
	printf("</html>\n");
	return 0;
}

   交叉编译该文件:/usr/local/arm/4.4.3/bin/arm-linux-gcc -static  -o test

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 14
    评论
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值