PHP via fastcgi stops responding sometimes in lighttpd v1.4.8. It can be replayed like belows:
php -i > test.php
ab -n 5000 -c 200 http://localhost/test.php
If you turn fastcgi.debug = 1, "unexpected end-of-file (perhaps the fastcgi process died)" will be reported.
I checked mod_fastcgi.c and found that fcgi_demux_response() process FIONREAD wrong. Line 2262 should return 0 instead of log_error_write and return -1. I have tested by myself and it works.
/* init read-buffer */
if (toread > 0) {
...
} else {
log_error_write(srv, __FILE__, __LINE__, "ssdsdsd",
"unexpected end-of-file (perhaps the fastcgi process died):",
...
}
/* init read-buffer */
if (toread > 0) {
...
} else {
return 0;
}