Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

-----------------EDIT:

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

2 Answers 2

up vote 4 down vote accepted

They are two bugs opened recently related to this issue:

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

[default]
listen = /tmp/php-fastcgi.sock
user = www
group = www
listen.owner = www
listen.group = www
listen.mode = 0660
share|improve this answer
    
yeap found it a while ago :) –  Danny Valariola Jul 11 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.

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

Your Answer

 
discard

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.