簡體   English   中英

在 raspberry pi 上的 lighttpd Web 服務器中通過 /var/www/cgi-bin 運行 .cgi 腳本

[英]Running a .cgi script via /var/www/cgi-bin in lighttpd web server on raspberry pi

我正在學習有關網絡驅動汽車的幾年前的教程

我有一個文件結構:

/var/

   /www/ (index.html for a webpage with buttons is contained here and displays 
    perfectly)

       /cgi-bin/ (containing cgi scripts with permissions granted)

html 代碼包含從 /cgi-bin/ 調用腳本的函數:

function centertilt()
{
    xmlhttp.open("GET","cgi-bin/centertilt.cgi",true);
    xmlhttp.send();
}

和調用這些函數的按鈕

button {
        color: blue;
        background:lightgrey;
        border: 1px solid #000;
        border-radius: 8px;
        position: center;
}
         ...
<button style="height: 50px; width: 100px; font-size: 25px" onclick="centertilt()">0</button>
         ...

當我通過 CLI 運行 .cgi 腳本時,它們運行良好,但按鈕在按下時不會調用它們。

您是否嘗試過在 CGI URL 中使用以“/”開頭的路徑?

xmlhttp.open("GET","/cgi-bin/centertilt.cgi",true);

您是否查看了 lighttpd 錯誤日志中的錯誤,或者查看了 lighttpd 訪問日志以查看請求的內容?

暫無
暫無

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

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