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 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献