An error occurred when accessing PHP files.

Server configuration ubuntu16, nginx, php5.6-fpm

 

My problem is that the user group does not have permission, which leads to An error occurred. When accessing the PHP file, the access to the Html page is normal.

 

Check the Nginx log for errors (path: /var/log/nginx/error.log, different version paths can be viewed in the nginx configuration file) 

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

 

Then I checked a lot of information and found that the user group was different and did not have permission to execute

1. nginx configuration file (/etc/nginx/nginx.conf): Change user nginx to user www-data; 

2. Check the php5.6-fpm configuration (/etc/php/5.6/fpm/pool.d/www.conf), in lines 23 and 24↓

user = www-data
group = www-data

 

After the change is completed, the refresh is successful.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325126846&siteId=291194637