簡體   English   中英

蟒蛇網絡服務器,sh腳本

[英]boa webserver, sh script

我這里有Linux嵌入式設備。 有一個網絡服務器蟒蛇。 http://www.boa.org/

我正在嘗試啟動sh cgi腳本。

#!/bin/sh
echo "Content-type: text/html\n"
echo "Hello world !"

./script.cgi有效,但是在網絡瀏覽器中我得到了

502錯誤的網關CGI不符合CGI / 1.1。

誰能幫我?

嘗試在您的內容類型行上添加一個\\ n。

另外,如果您的shebang或dos風格的行尾出現問題,蟒蛇也會報告類似的情況。

echo -e "Content-type: text/html\r\n\r\n"

您必須執行chmod

chmod 777 your_cgi_file

要么

chmod 755 your_cgi_file

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM