Basically, this is my development machine and the setup has been fine for a number of weeks now, but suddenly I'm getting a lot of issues with these errors:
[Thu Sep 27 16:28:43 2012] [error] [client 127.0.0.1] FastCGI: comm with server "/Library/WebServer/Documents/php5.external" aborted: idle timeout (60 sec) [Thu Sep 27 16:28:43 2012] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/Library/WebServer/Documents/php5.external"
I haven't changed anything related to the server config. Obviously something must've changed, or I've just become unlucky..
Setup is as follows:
Apache/2.2.22 (Unix) DAV/2 mod_fastcgi/2.4.6 mod_ssl/2.2.22 OpenSSL/0.9.8r $ php-fpm -v PHP 5.3.15 (fpm-fcgi) (built: Aug 19 2012 09:06:12) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans $ sudo lsof -i TCP:9000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php-fpm 97167 _www 6u IPv4 0xd65451f140772337 0t0 TCP localhost:cslistener (LISTEN) php-fpm 97174 _www 0u IPv4 0xd65451f140772337 0t0 TCP localhost:cslistener (LISTEN) php-fpm 97174 _www 3u IPv4 0xd65451f14739c337 0t0 TCP localhost:cslistener->localhost:54750 (CLOSE_WAIT) $ tail -16 /etc/apache2/httpd.conf <IfModule mod_fastcgi.c> FastCGIExternalServer /Library/WebServer/Documents/php5.external -flush -host 127.0.0.1:9000 -idle-timeout 60 AddHandler php5-fcgi .php Action php5-fcgi /usr/lib/cgi-bin/php5.external Alias /usr/lib/cgi-bin/ /Library/WebServer/Documents/ <Directory /usr/local/sbin> Options ExecCGI FollowSymLinks SetHandler fastcgi-script Order allow,deny Allow from all AllowOverride All </Directory> </IfModule>
It's pretty much a default php-fpm.conf with the log location changed, ondemand process manager, pm.max_children = 1 and everything else is default.
I've tried restarting apache dozens of times, and killing all the php-fpm processes, in different orders.
Any suggestions will be wildly encouraged, welcomed, appreciated, tried and hoped for.
Okay, so I used this tutorial and tried the socket approach to see if it was a TCP port collision - turns out its not. Using sockets also didn't help the every-10-second error messages like these:
[28-Sep-2012 08:44:58] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (48) [28-Sep-2012 08:44:58] ERROR: unable to bind listening socket for address '127.0.0.1:9000': Address already in use (48) [28-Sep-2012 08:44:58] ERROR: FPM initialization failed [28-Sep-2012 08:44:58] ERROR: FPM initialization failed
[28-Sep-2012 08:48:32] ERROR: An another FPM instance seems to already listen on /tmp/php5-fpm.sock [28-Sep-2012 08:48:32] ERROR: An another FPM instance seems to already listen on /tmp/php5-fpm.sock [28-Sep-2012 08:48:32] ERROR: FPM initialization failed [28-Sep-2012 08:48:32] ERROR: FPM initialization failed
I did figure out how to solve this though, and it's in the tutorial I just linked. The launch agent plist configuration needs to specify RunOnlyOnce. Not sure if this is safe for TCP though.
I do have some progress though, which might make this question too specific.. I use NetBeans for development, and when I tried to fire up a debug session using xdebug, it loads fine - cool - but as soon as the code needs pause on a breakpoint, I'm back at square 1.
comm with server ... aborted: idle timeout
Just to cover all my bases, I set -idle-timeout in httpd.conf to 300. No dice. If I shutdown Netbeans and don't try (ever) starting a debug session, the server won't die, it'll behave as intended.
I'm about to try rebooting my MacBook, but honestly that shouldn't be a valid solution..