Python 脚本在权限为 755 时通过 apache 运行,但在 777 时给出错误 500?
我将基本的 Python 脚本上传到 Dreamhost 的共享主机,并将权限更改为 777
。它在 shell 中运行良好(通过 SSH),但在从浏览器调用时会显示“服务器错误”。
在 error.log 中,错误为“脚本标头过早结束”
。
我写信给 DreamHost,他(出奇地快)回复了将权限更改为 755,并且脚本开始在 apache 中正常工作(我可以在浏览器中看到输出)。
但这似乎不对——添加额外宽松的权限怎么会破坏任何功能呢?
I uploaded a basic python script to my shared hosting at Dreamhost, and changed the permissions to 777
. It ran fine from the shell (via SSH) but would display a 'Server Error' when called from the browser.
In the error.log, the error was 'Premature end of script headers'
.
I wrote to DreamHost, who (surprisingly quickly) replied by changing the permissions to 755
, and the script started working properly in apache (I could see the output in the browser).
But this doesn't seem right - how can adding extra lenient permissions break anything from functioning?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
允许任何人编辑 CGI 脚本意味着很容易在系统中插入后门。 httpd 正确地禁止可疑程序运行。
Allowing anyone to edit a CGI script means that it would be easy to insert a backdoor into the system. httpd is correctly disallowing a suspect program to be run.