我的 nginx + php-fm 网络服务器能够为具有权限 000 的网页提供服务。为什么?

My nginx + php-fm webserver is able to serve web pages that have permission 000. Why?

也许我遗漏了一些非常基本的东西,但我的网络服务器如何能够执行和提供来自 php 个权限为 000 的文件的内容?

这是有问题的文件:http://178.62.125.162/test.php

位置是:

/usr/share/nginx/html/wordpress/test.php

这是 ls:

---------- 1 deploy deploy 21 May 22 09:40 test.php

nginx.conf 有行:

user www-data;

所以它不是 运行 作为 root 或任何东西。

ps aux | grep [n]ginx
root     30223  0.0  0.1  85876  1364 ?        Ss   May21   0:00 nginx: master process /usr/sbin/nginx
www-data 30224  0.0  0.1  86172  1796 ?        S    May21   0:03 nginx: worker process
www-data 30225  0.0  0.1  86172  1796 ?        S    May21   0:03 nginx: worker process
www-data 30226  0.0  0.2  86516  2732 ?        S    May21   0:00 nginx: worker process
www-data 30227  0.0  0.1  86172  1796 ?        S    May21   0:03 nginx: worker process

对我来说看起来很正常,AFAIK 主进程 运行 作为 root 是预期的。

和php-fm:

ps aux | grep php
root     30311  0.0  1.8 309068 18580 ?        Ss   May21   0:02 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
www-data 30314  0.0  3.5 393324 36176 ?        S    May21   0:01 php-fpm: pool www
www-data 30315  0.0  3.1 388956 32112 ?        S    May21   0:01 php-fpm: pool www
www-data 30391  0.0  2.9 389828 29528 ?        S    May21   0:00 php-fpm: pool www

我什至无法自己打开文件,以部署身份登录:

cat test.php
cat: test.php: Permission denied

php test.php
Could not open input file: test.php

到处都用谷歌搜索,但我发现的大多数东西都与相反的东西有关——人们得到禁止的错误。

也许是因为它在/usr/share?谢谢!

额外信息:

Ubuntu x64 LTS

PHP-FM

更新:

更改权限后重新启动 php-fm 服务可修复此问题。但这对我来说毫无意义:

chmod 000 test.php - web echos "test"
service php5-fm restart - Access Denied
chmod 644 test.php - web echos "test". No need for a restart this time?
chmod 000 test.php - web echos "test".

感谢 Alexander Ushakov 提供答案。

具有可读权限的文件已被php-fm缓存。重新启动 php-fm 意味着缓存已被清除,然后 Web 服务器以受限的访问权限提供新文件。