wrong ownership php5-fpm sockets

my php-fpm was upgrade via apt-get and it is causing all my sites to return back as 502 errors.. Upon looking at the nginx log, it was generating these:

2014/05/10 21:50:02 [crit] 1329#0: *39 connect() to unix:/var/run/fpm.boost.sock failed (13: Permission denied) while connecting to upstream, client:, server: http://www.boostmyfitness.com, request: "GET /wp-cron.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/fpm.boost.sock:", host: "www.boostmyfitness.com"

I looked at /var/run folder and saw all the fpm sockets were root:root.. it should be owned by username:www-data (based on pool.d conf file).. I am not sure where to fix that permission issue.. I can issue chown and get the site back up running until php-fpm is restarted.

Im running Ubuntu 14.04 with:

PHP 5.5.12-1+deb.sury.org~trusty+1 (cli) (built: May 8 2014 21:09:59)

nginx version: nginx/1.7.0



2 Replies

This was a security fix in PHP 5.5.12. Default perms on the socket changed from 0666 to 0660. The settings you need to specify are listen.owner and listen.group in php-fpm config for each pool.

I run my php-fpm process as a different user than my nginx process. To bridge the two users, I create a new group and added both users as members. Then I updated listen.group to the new group. You will have to restart nginx and php-fpm after doing this.



Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct