访问PHP文件时出现An error occurred.

服务器配置ubuntu16,nginx,php5.6-fpm

我的问题是用户组没有权限导致出现访问PHP文件时An error occurred.,访问Html页面正常。

查看Nginx日志报错(路径:/var/log/nginx/error.log, 不同版本路径可在nginx配置文件中查看) 

2 connect() to unix:/run/php/php5.6-fpm.sock failed (13: Permission denied) while connecting to upst

然后查了很多资料,发现是用户组不同导致没权限执行

1.nginx的配置文件(/etc/nginx/nginx.conf): 将user nginx修改为user www-data; 

2.查看php5.6-fpm配置(/etc/php/5.6/fpm/pool.d/www.conf),在23,24行↓

user = www-data
group = www-data

改完刷新就成功了。

猜你喜欢

转载自www.cnblogs.com/ZDuiy/p/8980504.html
今日推荐