Ubuntu php5-fpm unix socket

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

 /var/run/php5-fpm.sock

I have looked also

/tmp/php5-fpm.sock

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


Solution 1:

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

Look for the line:

listen = 127.0.0.1:9000

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.

Solution 2:

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.