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 python天天向上类似问题,但没有清零
  • ¥30 3天&7天&&15天&销量如何统计同一行
  • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码
  • ¥15 C#调用python代码(python带有库)
  • ¥15 矩阵加法的规则是两个矩阵中对应位置的数的绝对值进行加和
  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)