Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 27 down vote accepted

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.

share|improve this answer
    
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 = 127.0.0.1:9000. 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. –  eegg Apr 30 at 9:47

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.