在 raspberry pi 上的 lighttpd Web 服务器中通过 /var/www/cgi-bin 运行.cg



我正在按照几年前的关于网络驱动的汽车的教程进行操作

我有一个文件结构:

/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 访问日志以查看请求的内容?

相关内容

最新更新