为什么 index.php 权限 666 出现“500 内部服务器错误”?

Why "500 internal server error" with index.php permission 666?

在新的 Wordpress 站点中(这可能对其他站点也有效),将 index.php 权限设置为 0666 使得

Error 500: Internal server error

但只需将其权限更改为 0644 即可解决问题。 为什么?

您的 Apache 配置可能有一些 php 处理程序,例如 suphp:

http://www.suphp.org/Home.html

suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.

由于 suPHP 使您的 PHP 脚本 运行 具有与您的普通用户帐户相同的权限,因此您不需要组或世界写入权限或执行文件和作为安全预防措施,PHP 甚至会阻止 运行ning 组或世界可写或可执行的文件。