When i'm setting the user in nginx.conf to root root:

user  root root;

then my website is working, but when i set it to nginx nginx i get error in the logs:

connect() to unix:/var/run/php-fpm/php-fpm.sock failed (13: Permission denied)

i'm using PHP-FPM 5.5, and i made sure the folder owner is nginx + executing permission are enabled.

what am i missing..? Thx


quick edit when changing php-fpm.sock permissions manually it's working. how do i start php-hpm with the right permissions?

2 Answers 2


There are two bugs opened recently related to this issue:

I personally experience the first one on FreeBSD with php version 5.4.30. For a workaround I applied both parameters available to specify the owner of the socket like this:

listen = /tmp/php-fastcgi.sock
user = www
group = www
listen.owner = www
listen.group = www
listen.mode = 0660
  • yeap found it a while ago :) Commented Jul 11, 2014 at 13:30

Check official documentation. You can use listen.owner or user to specify the owner of unix socket.

listen.owner string

Set permissions for unix socket, if one is used. In Linux, read/write permissions must be set in order to allow connections from a web server. Many BSD-derived systems allow connections regardless of permissions. Default values: user and group are set as the running user, mode is set to 0666.

listen.group string

See listen.owner.

user string

Unix user of FPM processes. This option is mandatory.

group string

Unix group of FPM processes. If not set, the default user's group is used.

  • that was it....in AWS RedHat 6.4 Image the default was 0660 for some reason... i changed it and it worked, thx. Commented May 5, 2014 at 23:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .