"Access to the script '/data/www/jiemo/index.html' has been denied (see security.limit_extensions)

前提是你 提交于 2019-12-11 20:02:03

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

    访问index.html 在里面写了php代码,执行后显示 Access Denied 然后报错日志显示:

FastCGI sent in stderr: "Access to the script '/data/www/jiemo/index.html' has been denied (see security.limit_extensions)" while reading response header from upstream

处理办法是在php-fpm.conf中的配置文件里,找到security.limit_extensions,添加一个. html

security.limit_extensions = .html .php .php3 .php4 .php5

这个指令的作用是:限制主脚本FPM允许解析的扩展。这可以防止web服务器端的配置错误。您应该仅将FPM限制为.php扩展,以防止恶意用户使用exectute php代码的其他扩展。

所以要解析 .html执行php,需要在这块添加。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!