nginx error connect to php5-fpm.sock failed (13: Permission denied)

后端 未结 25 1731
悲哀的现实
悲哀的现实 2020-11-27 09:12

I update nginx to 1.4.7 and php to 5.5.12, After that I got the 502 error. Before I update everything works fine.

相关标签:
25条回答
  • 2020-11-27 09:38

    Alternative to broadening permissions in your php config, you could change the user specified in your nginx config.

    On the first line of your nginx.conf excerpt above, the user and group are specified as www and www, respectively.

    user  www www;
    

    Meanwhile, your php config probably specifies a user and group of www-data:

    listen.owner = www-data
    listen.group = www-data
    

    You might change the line in your nginx.conf, to any of the following, then:

    user www-data www;
    user www-data www-data; # or any group, really, since you have the user matching
    user www www-data; # requires that your php listen.mode gives rw access to the group
    
    0 讨论(0)
提交回复
热议问题