Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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 = www
listen.mode = 0660
share|improve this answer
yeap found it a while ago :) – Danny Valariola Jul 11 '14 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. 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.

share|improve this answer
that was AWS RedHat 6.4 Image the default was 0660 for some reason... i changed it and it worked, thx. – Danny Valariola May 5 '14 at 23:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.