gpt4 book ai didi

linux - python 网络服务器,sh脚本

转载 作者:太空宇宙 更新时间:2023-11-04 09:08:54 26 4
gpt4 key购买 nike

我这里有带 linux 的嵌入式设备。有一个网络服务器 python 。 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 风格的行尾有问题,boa 也会报告类似的情况。

关于linux - python 网络服务器,sh脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3476706/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com