【发布时间】:2014-12-15 10:41:20
【问题描述】:
最近在使用 apache 的服务器上设置了 PHP-FPM,它运行得非常好,但是一些 png 文件我被拒绝访问,例如 https://socialsavanna.com/scripts/candy-1.6.0/res/img/action/statusmessage-off.png
在我得到的错误日志中
FastCGI: server "/{DirectoryToCGIBin}/php5-fcgi" stderr: Access to the script '/{DirectoryToWebsite}/scripts/candy-1.6.0/res/img/action/statusmessage-on.png' has been denied (see security.limit_extensions)
其他 png 工作正常,为什么 Apache 将其转发到 FastCGI 以解析为 PHP 文件?有什么想法可以阻止这种情况吗?
谢谢
编辑:配置
LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
DirectoryIndex index.php index.html index.shtml index.cgi
AddHandler php5-fcgi .php
Action php5-fcgi /php5-fcgi
Alias /php5-fcgi /{DirectoryToCGIBin}/php5-fcgi
FastCgiExternalServer /{DirectoryToCGIBin}/php5-fcgi -socket /{socketPath}/php5-fpm.sock -pass-header Authorization
# For monitoring status with e.g. Munin
<LocationMatch "/(ping|status)">
SetHandler php5-fcgi-virt
Action php5-fcgi-virt /php5-fcgi virtual
</LocationMatch>
【问题讨论】:
-
为什么要使用 Apache 和 PHP-FPM?为什么不使用 nginx 和 PHP-FPM?我相当肯定 Apache 自带 Apache
-
我稍后会关注 Nginx,我对 Apache 更熟悉,所以一步一步来,但是将 mod_php 切换到 php-fpm 运行得更好。
-
"Apache 自带 Apache"?
-
@covener 我很确定 iWontStop 试图指出他们对 Apache 的仇恨。
-
只是好奇这是什么意思(或应该说)