Python 脚本在权限为 755 时通过 apache 运行,但在 777 时给出错误 500?

发布于 2024-08-16 06:45:07 字数 277 浏览 5 评论 0原文

我将基本的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぃ弥猫深巷。 2024-08-23 06:45:07

允许任何人编辑 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文