[Mod_gzip] Empty output with all .php pages

Glenn mod_gzip@lists.over.net
Sun, 27 Apr 2003 12:50:37 -0400


On Sun, Apr 27, 2003 at 04:18:59PM +0100, Matt Dickinson wrote:
> > But when I get to any php output, then there's nothing outputted,
> > save for <html><body></body></html>
> > 
> > [27/Apr/2003:15:31:07 +0100] "GET /phpinfo.php HTTP/1.1" 200 50057 "-"
> > "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a; MultiZilla
> > v1.4.0.3H) Gecko/20030312" In:0 Out:0:0pct.
> 
> I've subsequently discovered:
> 
> [27/Apr/2003:16:17:26 +0100] \GET /test.php HTTP/1.1\ 200 50214 mod_gzip:
> DECLINED:HAS_CE In:0 Out:0:0pct.
> 
> DECLINED:HAS_CE... But I've no idea what to look for now!

DECLINED:HAS_CE I think means that the output returned from the CGI script
already has a _C_ontent _E_ncoding.  Kevin Kiley, the author of mod_gzip
did extensive testing to determine that almost all browsers did not properly
handle multiple content-encodings (even though such is allowed by the RFCs)
and so mod_gzip will refuse to add a content-encoding if one already exists.

You can find excellent documentation for mod_gzip at
  http://www.schroepl.net/projekte/mod_gzip/
It is clear you haven't seen
  http://www.schroepl.net/projekte/mod_gzip/status.htm


Anyway, take a look in your php.ini
  (/etc/php.ini or /usr/local/lib/php.ini are good places to look)
and make sure that PHP is _not_ already performing gzip compression on
the content.  The appropriate lines from my php.ini are:

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "ob_gzhandler", output will be
; transparently compressed for browsers that support gzip or deflate encoding.
; Setting an output handler automatically turns on output buffering.
output_handler =
                                                                                
; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
zlib.output_compression = Off


I think you mentioned that you were using Apache2.  It would be a good
idea to search the list archives for more information about that.
You might also look at mod_deflate, which in the latest Apache 2.0.45
compares reasonably in performance to mod_gzip on Apache 1.3 when the
new DeflateCompressionLevel is tuned about 3-6.

Cheers,
Glenn