Novice here, so please be gentle :)

I'm installing Nginx with php5-fpm on a Ubuntu 10.04 box according to this guide by ArsTechnica: http://arstechnica.com/information-technology/2012/12/web-served-part-3-bolting-on-php-with-php-fpm/

Nginx is up and running, it serves static html fine. I'm running into problems with getting php5-fpm to work. I'm getting a 502 bad gateway error, when I look into the log it says:

connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream

When I go back through the guide it mentions to configure /etc/php5/fpm/pool.d/www.conf. I don't seem to have a pool.d directory at all, and no file named www.conf.

I do have php-fpm.conf in the /etc/php5/fpm directory that has similar settings to the ones described in the guide (listen = /var/run/php5-fpm.soc, etc). Can I use this file or has something gone wrong in installing php5-fpm?

1 Answer 1


pool.d/www.conf is most likely just a file that gets included by php-fpm.conf. so you can either create that file and include it in php-fpm.conf or just put its content into the php-fpm.conf directly.

if you have the lsten directive in php-fpm.conf the socket file should be created once php-fpm gets started.

  • When I look at /var/run it has a file named php5-fpm.soc (.soc, not .sock). Can this be the source of the problem? I can't figure out wich file references .sock instead of .soc?
    – Squrler
    Feb 21, 2013 at 15:01
  • is that maybe just a typo? usually its .sock, not sic, so try changing your php conf to sock
    – replay
    Feb 21, 2013 at 18:49
  • Yup, turned out it was; once I corrected php5-fpm.conf with the added k everything worked. Thanks so much!!
    – Squrler
    Feb 21, 2013 at 23:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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