我有以下CGI脚本启动Flask Web应用程序。但我得到的只是500 Internal Server Error
#!/home/xxx/public_html/cgi-bin/venv/bin/python
import site
site.addsitedir("/home/xxx/public_html/cgi-bin/venv/lib/python2.7/site-packages")
from wsgiref.handlers import CGIHandler
from app import app
CGIHandler().run(app)
我在Apache error_log
中遇到以下错误:
[Fri Jan 27 09:53:18.052981 2017] [cgi:error] [pid 20660] [client aa.bb.cc.dd:58331] AH01215: suexec policy violation: see suexec log for more details: /home/xxx/public_html/cgi-bin/app.cgi, referer: http://xxx.io/
[Fri Jan 27 09:53:18.053176 2017] [cgi:error] [pid 20660] [client aa.bb.cc.dd:58331] End of script output before headers: app.cgi, referer: http://xxx.io/
suexec_log
中的以下错误:
[2017-01-27 09:53:18]: uid: (522/xxx) gid: (534/xxx) cmd: app.cgi
[2017-01-27 09:53:18]: (2)No such file or directory: exec failed (app.cgi)
所有文件都应该放在所有正确的位置。不确定如何继续调试。如果有帮助,我对该服务器有root权限。
答案 0 :(得分:2)
两个问题:
$result = my_web_service_consume_data();
$variables = array(
'results' => $results
);
$block['content'] = theme('block__my_web_service', $variables);
文件包含Windows行结尾
.cgi
解决一旦我解决了这些问题,它就像一个魅力!