Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Heroku sock=后端(H18)上的CGI错误_Python_Heroku_Cgi - Fatal编程技术网

Python Heroku sock=后端(H18)上的CGI错误

Python Heroku sock=后端(H18)上的CGI错误,python,heroku,cgi,Python,Heroku,Cgi,我一直在尝试在heroku上运行CGI脚本,但运气不好 我在回答中遵循了以下建议: (通过编辑procfile来运行python CGI服务器),但是我从heroku日志中得到了一个H18错误。以下是错误: 2015-12-07T00:33:49.452384+00:00 heroku[router]: sock=backend at=error code=H18 desc="Server Request Interrupted" method=GET path="/cgi-bin/dilap

我一直在尝试在heroku上运行CGI脚本,但运气不好

我在回答中遵循了以下建议:

(通过编辑procfile来运行python CGI服务器),但是我从heroku日志中得到了一个H18错误。以下是错误:

2015-12-07T00:33:49.452384+00:00 heroku[router]: sock=backend at=error code=H18 desc="Server Request Interrupted" method=GET path="/cgi-bin/dilaps.cgi" host=blooming-beyond-1824.herokuapp.com request_id=a53e612c-1148-4f62-93fe-737aaee5af1d fwd="58.96.22.170" dyno=web.1 connect=1ms service=1170ms status=503 bytes=11383
这到底意味着什么?我如何着手修复它?没有发生其他错误

这是我的目录结构,以防相关

Procfile
jobs -> *txt files
setup.py
cgi-bin -> dilaps.cgi
js -> *js files
css -> *css files
requirements.txt

我遇到了一个问题:Heroku的HTTP路由器对报头中的回车要求严格,而我的浏览器则比较宽松。因此,我的脚本在测试期间有效,但在Heroku上无效

所以这个脚本起作用了:

#!/bin/sh
printf 'Content-Type: text/plain\r\n'
printf '\r\n'
echo "hello world"
。。。此脚本在H18中失败:

#!/bin/sh
echo "Content-Type: text/plain"
echo
echo "hello world"