dqybjj3497 2016-06-28 09:48
浏览 101

Nginx PHP5.6权限错误

I am getting the following error in my Nginx error.log file, what do I need to do to prevent this from happening?

2016/06/28 09:43:37 [crit] 1631#0: *1 connect() to unix:/run/php/php5.6 fpm.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.56.1, server: my-vm, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php5.6-fpm.sock:", $host: "my-vm-1"

Nginx runs with www-data permissions. The permissions of the folder that the error message is referencing (/run/php/php5.6-fpm.sock) are as follows:

drwxr-xr-x 20 root       root         700 Jun 28 09:45 run
drwxr-xr-x 2  www-data   www-data     80  Jun 28 09:44 php
srw-rw---- 1  www-data   www-data     0   Jun 28 09:44 php5.6-fpm.sock

The user/group of PHP (/etc/php/5.6/fpm/pool.d/www.conf) is:

user = www-data
group = www-data
listen.owner = www-data
listen.group = www-data
listen.mode = 0660

The nginx.conf file does not have any user value set. Some people have suggested setting this to www-data, but if I set this the Nginx service won't start, hence why it is ommitted.

  • 写回答

1条回答

  • dou91808 2016-06-28 10:51
    关注

    I fixed this by adding the following user directive to the top of my nginx.conf file:

    user www-data www-data;
    
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?