文件/usr/local/nginx/logs/error.log
FastCGI sent in stderr: "Access to the script '/var/www/html//phpmyadmin/setup/styles.css' has been denied (see security.limit_extensions)"
打开日志发现会出现security.limit_extensions 这样的错误。
经过查找资料发现 从5.3.9开始,php官方加入了一个配置"security.limit_extensions",默认状态下只允许执行扩展名为".php"的文件,造成了其他类型的文件不支持的问题。
所以更改策略如下:
修改/usr/local/php/etc/php-fpm.conf,找到security.limit_extensions把他修改为:
security.limit_extensions=.php .html .js .css .jpg .jpeg .gif .png .htm#(常用的文件扩展名)
然后问题就解决啦!
CGI(Common Gateway Interface) 是WWW技术中最重要的技术之一,有着不可替代的重要地位。
CGI是外部应用程序(CGI程序)与WEB服务器之间的接口标准,是在CGI程序和Web服务器之间传递信息的过程
Nginx 服务器和php的关联配置
nginx.conf文件中:
server{
location ~ .php${ #location 跳转 ~:不区分大小写 ~*:区分大小写 .php$:.php结尾的文件
root html;
fastcgi_pass 127.0.0.1 :9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* .*index.html${
rewrite .* /test.html #rewrite regex replacement:rewrite 正则 字符串
}
}
————————————————
版权声明:本文为优快云博主「社会刘」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/qq_37779709/article/details/78761515