Forum Moderators: coopster
When I try to set zlib output compression either in my php.ini or a virtual hosts entry in my httpd.conf file, all I get is garbage characters. I am guess that apache is not properly sending out a MIME type identifying the compressed file, so my browser is rendering compressed data.
I have the following in my httpd.conf:
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
AddType application/x-tar .tgz
I'm not such a specialist on apache and mime types, but one possible way you might be able to hack yourself out of this before you really figure things out (like if you need to be deployed now) is just put header('Content-Encoding: gzip'); somewhere in your script before there's anything output to the browser. Check php.net also on header() to see the various options regarding overwriting previous headers if for some reason these headers are being sent.
Another thing to try: the function ob_gzhandler();
However, if I set an output_handler to ob_gzhandler, then it compresses and sends the proper MIME type.
Strange....