PHP Oddity
2005-02-17T22:33:04Z
Discovered a little oddity with PHP and Firefox. In my root .htaccess file I have:
php_flag zlib.output_compression On
php_value zlib.output_compression_level 9
This causes all PHP files to be compressed, if the user agent accepts compression.
My error page is also a PHP script, mostly to trap the referring URL and include that in the page. Entirely by accident tonight I discovered that the error page was being returned as complete gibberish to Firefox. My guess is that Firefox was receiving the error page as a compressed page, but was not uncompressing it.
A little investigation with the Live HTTP Headers extension revealed that the page was being served with Transfer-encoding: chunked instead of Content-encoding: gzip.
I don't know where to look to debug further, but did manage to override the behaviour on the server side by adding:
php_flag zlib.output_compression Off
to the .htaccess for the directory containing my error pages.