[英]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.