I have Ubuntu 11.10 and installed php5-fpm and I want to configure nginx. I want to use unix sockets instead of tcp sockets but I couldn't find the


I have looked also


Where is php5-fpm.sock file? I also tried

locate php5-fpm.sock

but I couldn't find anything. Note: php5-fpm is working . I have started as a service http://blog.bigdinosaur.org/wordpress-on-nginx/ http://blog.nas-admin.org/?p=25


In the default configuration before 12.10 Quantal, PHP FPM is set to listen on TCP port 9000 on address This can be changed in /etc/php5/fpm/pool.d/www.conf.

Look for the line:

listen =

and change it to something like:

listen = /var/run/php5-fpm.sock

After doing so, restart PHP FPM:

sudo /etc/init.d/php5-fpm restart

(note: reload is broken on Oneiric as it sends a HUP signal to php5-fpm which is wrong. It's fixed in Precise by sending USR2, bugreport).

Note: as mentioned by @SpamapS (palingdrome :D), newer releases use Unix sockets by default, not the tcp socket. See this Launchpad comment, it got changed in 12.10 Quantal.

  • Just a note, on precise, php5-fpm actually runs on a socket by default. ;) – SpamapS Apr 27 '12 at 20:40
  • 5
    @SpamapS I don't think so, the changelog does not mention anything. Just to be sure, I checked the php5-fpm .deb package for version 5.3.10-1ubuntu3 and it still contains listen = Perhaps you've previously changed this and upgraded while keeping the conffiles? – Lekensteyn Apr 27 '12 at 21:25
  • 1
    Well no, I submitted the change to Debian, and they merged it, but only to the PHP 5.4 packages. I actually mistakenly set the bug status on pad.lv/900620 , so thanks for the heads up, set it back to Triaged. We'll pick it up on the next merge from Debian. – SpamapS Apr 28 '12 at 0:53
  • In 14.04, it appears to use a UNIX socket by default, so things must have changed. – jameshfisher Apr 30 '14 at 9:47

Unfortunately this method is old and will no longer work . OLD

sudo /etc/init.d/php5-fpm restart

Now a days you need to use

sudo service php5-fpm restart

In place of restart you may also use; start, stop and reload.

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.