网站无法加载json文件

 错误日志如下

2019/02/22 12:14:11 [error] 24225#0: *10768 FastCGI sent in stderr: "Access to the script '/var/www/html/ad-server/manifest.json' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 42.200.169.121, server: test.gadmobe.com, request: "GET /manifest.json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9003", host: "test.gadmobe.com", referrer: "http://test.gadmobe.com/push/webpush-content.php?debug=1"


检查文件是否存在 &  权限

说明:文件存在 以及 权限没问题

$ ll /var/www/html/ad-server/manifest.json

-rwxr-xr-x 1 www www 77 Feb 22 11:34 /var/www/html/ad-server/manifest.json


解决

说明:根据错误日志出现security.limit_extensions 的错误,经过查找资料发现从5.3.9开始,php官方加入了一个配置"security.limit_extensions",默认状态下只允许执行扩展名为".php"的文件,造成了其他类型的文件不支持的问题

$ vim /usr/local/php-fpm/etc/php-fpm.conf

#将.json放在后面

security.limit_extensions=.php .html .js .css .jpg .jpeg .gif .png .htm .ico .json


#重启php就解决啦

 

转载于:https://my.oschina.net/AnnaWu/blog/3013509

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值