/*********************************************************************
* Author : lile
* Modified : 2019年12月28日星期六 10:16:13
* Email : [email protected]
* HomePage : lile777.blog.csdn.net
* CopyRight : 該文章版權由lile所有。
* 保留原文出處鏈接和本聲明的前提下,可在非商業目的下任意傳播和複製。
* 對於商業目的下對本文的任何行爲需經作者同意。
*********************************************************************/
現象
[27/Dec/2019:13:51:55 +0000] cgi_header: unable to find LFLF
原因
cgi文件升級異常,大小爲0 !!!
重新升級後,正常。
/www/cgi-bin # ls -l
total 688
-rwxrwxrwx 1 root root 169696 Dec 27 10:57 boot_args.cgi
-rwxrwxrwx 1 root root 268432 Dec 27 10:57 data_update.cgi
-rwxrwxrwx 1 root root 1012 Nov 29 15:44 sys.xml
-rwxrwxrwx 1 root root 778 Dec 27 10:57 sys_1.xml
-rwxrwxrwx 1 root root 0 Dec 27 10:57 upload.cgi
-rwxrwxrwx 1 root root 252840 Dec 26 18:03 upload.cgi-bak
解決
/www/cgi-bin # cp upload.cgi-bak upload.cgi
網絡筆記
boa 服務器:cgi_header: unable to find LFLF
問題:
程序已確定有如下代碼:
printf(“Content-type:text/html\n\n”);
boa運行cgi,板子上一直出現錯誤的提示:cgi_header: unable to find LFLF
解決辦法:
將CGI文件的權限修改成777 :sudo chmod 777 *.cgi
CGI編程遇到的問題:急!!!!!cgi_header: unable to find LFLF [問題點數:20分]
我現在做基於嵌入式的網絡編程,採用boa+cgi的方式,採用shell語言編寫cgi程序,但是在表單提交給相應的cgi程序後,在超級終端可以看見這樣的錯誤信息:cgi_header: unable to find LFLF 不知道怎麼回事 望告知 不甚感謝!!!!
2009-04-15 20:12:23 shengxiaoye
首先,檢查你的 printf(“Content-type: text/html\n\n”);是否少了\n;
其次,也是最大的可能就是你的程序寫錯了。
程序已確定有如下代碼: printf(“Content-type:text/html\n\n”);
boa運行cgi,板子上一直出現錯誤的提示:cgi_header: unable to find LFLF
解決辦法: 將CGI文件的權限修改成777 :sudo chmod 777 *.cgi
cgi_header: unable to find LFLF錯誤的一種可能
-
你少了這一句: printf(“Content-type: text/html\n\n”); 在你輸出任何東西回到客戶端前, 都需要先宣告這類 header
另一些可能是 printf(“Content-type: image/jpeg\r\n\r\n”); -
寫 post 去的地方是 cgi-bin/mul.cgi
2.1 你確定你的檔已放到 cgi-bin
xuhaikun123
我也出現同樣的現象,但我的錯誤不是頭。
而是我在使用printf打印一個整數的時候,我使用了s%,後來改成d%就可以了。。。
boa cgi程序cgi_header: unable to find LFLF
ftp必須用二進制模式上傳纔可以
cgi_header: unable to find LFLF
我非常噁心做嵌入式web
出錯位置
cgi_procee_header()
對於錯誤 cgi_header: unable to find LFLF的補充
瀏覽器中顯示502 Bad Gateway
The CGI was not CGI/1.1 compliant.
可能的原因:
<1>輸出MIME格式錯誤,結尾一定要有兩個換行符
printf(“Content-Type:text/html\n\n”)
<2>權限錯誤
chmod 777 var/www/cgi-bin/xxx.cgi
<3>編譯方式:arm-linux-gcc -static -o xxx.cgi xxx.c
<4>代碼本身錯誤也會引起這個問題。實踐中這個問題困擾了很久,一個字符串數組的處理有了問題,提示的錯誤信息卻是這個,開始一直鬱悶于格式和權限,苦惱了兩天,才發現是調用的一個小函數有些問題而導致的。所以在遇到這個問題時,如果輸出格式和權限都正確的情況下,檢查代碼是個很好的選擇。
boa 服務器 錯誤 cgi_header: unable to find LFLF錯誤的一種可能
原創程序員豬豬俠 發佈於2013-12-04 15:22:10 閱讀數 2320 收藏
展開
-
你少了這一句: printf(“Content-type: text/html\n\n”);
在你輸出任何東西回到客戶端前, 都需要先宣告這類 header
另一些可能是 printf(“Content-type: image/jpeg\r\n\r\n”); -
寫 post 去的地方是 cgi-bin/mul.cgi
2.1 你確定你的檔已放到 cgi-bin 下去 ? 並且已設成 755 / 777 ?
2.2 你確定檔案名叫 mul.cgi 而不是 mlu.cgi ? (你放代碼的頁面 title 寫的是 mlu.cgi