Hello,
I converted my lighttpd config to nginx (1.0.11), but I am getting segfaults in php with nginx that I never had a problem with in lighttpd. I am using spawn-fcgi to spawn the php instances, tried the original version and an updated version, neither seemed to make any difference. I am using a custom forked PHP 4.4.9 (with eAccelerator), which I suspect is what nginx is not playing nice with. Using the latest 1.x branch of lighttpd has no issues, however.
Here are some logs: (actual site removed, so as to not be advertising)
nginx error log:
2012/01/26 21:13:33 [error] 15585#0: *367626 upstream prematurely closed connection while reading response header from upstream, client: 66.249.72.22, server: forums.mysite.com, request: "GET /info.php/info.php?p=12&l=21 HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "forums.mysite.com"
2012/01/26 21:16:20 [error] 15583#0: *388310 upstream prematurely closed connection while reading response header from upstream, client: 83.243.57.5, server: forums.mysite.com, request: "GET /index.php/admin/categories.php/login.php?cPath=&action=new_product_preview HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "forums.mysite.com"
2012/01/26 21:16:21 [error] 15583#0: *388358 upstream prematurely closed connection while reading response header from upstream, client: 83.243.57.5, server: forums.mysite.com, request: "GET /index.php/admin/file_manager.php/login.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fastcgi.sock:", host: "forums.mysite.com"
/var/log/messages
Jan 26 21:13:33 media kernel: php[15596]: segfault at 0000000000000000 rip 000000372c278d80 rsp 00007fffe482dd68 error 4
Jan 26 21:16:20 media kernel: php[15597]: segfault at 0000000000000000 rip 000000372c278d80 rsp 00007fffe482dd68 error 4
Jan 26 21:16:21 media kernel: php[15609]: segfault at 0000000000000000 rip 000000372c278d80 rsp 00007fffe482dd68 error 4
One thing I noticed is the malformed urls, but this degrades fine in practice. The other obvious thing is the "upstream prematurely closed connection" error, which when I matched up more lines, it was always this type of error. It seems that whatever nginx is doing to terminate the php (during a connection interrupted) is causing it to segfault. The main fcgi process seems to respawn them after a crash, but I'm worried about leaving this running in production, and have switched back to lighttpd for the time being, until a workable resolution is found.
If I have some time, I'll write/use a test app that closes the connection after receiving data, rather than using a connection-close header directive. This would isolate this as in fact a bug with nginx and the php/fastcgi version I'm using.
Final thought: There is a slight difference in my config of the php children, with lighttpd I have 6 workers that spawn 16 children each (96 total), but with nginx, I just had a single socket that spawned 64 children. I would be surprised if this made any difference, but wanted to add it for completion sake.
My apologies if this is in the wrong forum, I could not find a bug report forum. Please move there if possible, or if that is a more appropriate location.
Thanks in advance!