I am not able to disable gzip

I tried several ways to disable gzip compression, but unsuccessfully.

These settings were tried:

Htaccess file

SetEnv no-gzip dont-vary
php_flag zlib.output_compression “0”
php_flag zlib.output_compression_level “-1”

Php

apache_getenv (“no-gzip”);
ini_set (‘zlib.output_compression’, '0 ');
ini_set (‘zlib.output_compression_level’, “-1”);

Php.ini

zlib.output_compression = Off
zlib.output_compression_level = -1

Nothing worked. Watching the Live HTTP Header in Firefox, I keep getting the following header:

HTTP/1.1 200 OK
Date: Sun, 22 Aug 2010 07:04:43 GMT
Server: MicroRack Apache/1.3.41 (Unix) mod_ssl/2.8.31 OpenSSL/1.0.0a PHP/5.2.14
X-Powered-By: PHP/5.2.14
Keep-Alive: timeout = 15, max = 100
Connection: Keep-Alive
Content-Type: text / html
Content-Encoding: gzip “gzipped”
Content-Length: 216

I believe that the compression level is still done in PHP and not in Apache, because when I do not use a PHP script I get headers without compression. See for yourself:

Chuncked -> http://www.twd.com.br
Gzipped: -> http://www.twd.com.br/evs/flush.php

My php info: http://www.twd.com.br/info.php

Any alternatives or suggestions?

P.S. Sorry 4 my english.

Its not PHP. It is Apache.

Why are you sure about that??

Because zlib.output_compression is off. It is either Apache, or you are specifically using output buffering with compression in your code.

The Apache modules section of your phpinfo() says you have mod_gzip loaded. I’d start by looking into the directives for that module.

I’m not familiar with mod_gzip as I’ve always used mod_deflate or saved .gz files on my own and just sent headers for them, but according to this one of mod_gzips directives allows for a minimum content length before compression.

What happens if your normal index.html file gets up around a kb or 10, do you get the compression for it then?

Hum … a normal HTML file with 10k is also being gzipped. Nice tip joebert, ty.

I tried disabling it directly into Apache using:

httpd.conf

<IfModule mod_gzip.c>
mod_gzip_on no
mod_gzip_compression_level 0
</ IfModule>

But the content is still being sent gzipped to the browser.

HTTP Response: Content-Encoding: gzip

Any ideas?

SOLVED

To disable mod_gzip for a specific virtuahost block, add in the httpd.conf:

Compression No

Regards!

Just so I’m clear, “Compression” is a directive provided by mod_gzip and not something else, right ?

I wish I could find an easy to use index of the directives mod_gzip uses in the format Apache.org uses for the Apache 2.2+ documentation. All I can seem to find is examples of configurations, and no sort of index.