8

I have PHP-FPM setup with Apache 2.4 using proxy_fcgi, all works fine, but every one in 4-6 requests, Apache returns a blank page. This happens on my main site http://danielhe.com/, but not subdomain vhosts.

This shows up Apache's error log, [client x] AH01070: Error parsing script headers

And eventually, sometimes Apache segfaults AH00052: child pid 9740 exit signal Segmentation fault (11)

I can reproduce the "Error parsing script headers" very easily by refreshing the page a couple times, but the seg fault happens randomly after a couple of "Error parsing script headers"

Update I have found a fix for the seg faults, and the WSOD has apparently fixed itself. mod_deflate has some issues, but this config from the Apache documentation fixed it

SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpeg|jpg|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

migrated from stackoverflow.com Aug 26 '12 at 18:26

This question came from our site for professional and enthusiast programmers.

  • 2
    You should answer your own question and mark it as an accepted answer to make this question looks like a solved one – regilero May 29 '12 at 12:13
2

The solution was to use this configuration

SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpeg|jpg|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
  • Are you sure that problem is in mod_deflate? Any references? Looks very strange... – GioMac Aug 26 '12 at 19:17
  • @GioMac: I've no idea - the OP says that's what solved the problem in the question. I just put it in an answer. Note that SO sent it to us and it was originally answered on March 9th 2012. – Iain Aug 26 '12 at 19:27
0

I can confirm the above solution worked for me but I had to fix my ProxyPassmatch settings as well.

Old config

<IfModule proxy_module>
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/home/YOURDOMAIN/public_html/$1
</IfModule>

New config - different rewrite filter, plus code from above

<IfModule proxy_module>
ProxyPassMatch ^(.*\.php)$ fcgi://127.0.0.1:9000/home/YOURDOMAIN/public_html/$1
</IfModule>

<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
...code from above
</IfModule>
0

The problem here is that the response from phpList doesn’t fill a full package. php-fpm breaks off connection with Apache prematurely if its response doesn’t fill at least one buffer. As a work-around you can switch to mod_php temporarily or pad out the response with some randomly generated text.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.