Forum Moderators: phranque

Message Too Old, No Replies

Gzip just randomly stopped working

         

jake66

3:27 am on May 7, 2008 (gmt 0)

10+ Year Member



I was using this method for quite some time:
output_buffering = On
output_handler = ob_gzhandler
zlib.output_compression = Off

in my website's public_html folder inside php.ini

The other night, it stopped gzipping content. I have a phpbb on the same directory and it is still gzipped (via the built in gzipping in phpbb's scripts).

On the root part of the website I cannot use the same method of gzipping for some reason.. just doesn't work. htaccess gzipping doesn't work either, I get a 500 error.

What would cause it to just stop working through my php.ini?

I do have root access to my server. Is there something I may have accidentally disabled in httpd.conf?

TheMadScientist

3:15 pm on May 8, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, it appears you could have changed a mod_deflate setting, which would change your ability to use compression.

Apache Mod_Deflate [httpd.apache.org]

[edited by: TheMadScientist at 3:15 pm (utc) on May 8, 2008]

jake66

4:07 am on May 10, 2008 (gmt 0)

10+ Year Member



Thank you!

I tried adding:

AddOutputFilterByType DEFLATE text/html text/plain text/xml

to my .htaccess, but got a 500 error.

Is this a setting that must be edited in the httpd.conf file? If so, what is the value I should change?

TheMadScientist

7:14 am on May 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Actually, I think all settings need to be in the httpd.conf. You can use VirtualHost settings, containers, matching patterns, etc. to specify which site(s), directory(s), file type(s) you would like to compress.

I think there are some good examples in the section on enabling compression, and if you are using 'virtual host' containers, you should be able to adjust settings individually per container.

jake66

8:49 am on May 11, 2008 (gmt 0)

10+ Year Member



How can I tell if I am using anything to match containers or patterns?

I don't recall setting anything with these names before, I just loaded my php.ini one day and it worked.. then all of a sudden didn't.. so I'm not entirely sure how to update these values.

I've modified the httpd.conf file before, but no values with names similar to what you posted.. I'm a bit lost. :)

jake66

3:22 am on Jun 8, 2008 (gmt 0)

10+ Year Member



For any other newbies like myself reading this that had problems..

I opened up SSH and:

pico /usr/local/lib/php.ini

Changed: output_buffering from Off to On

then I moved down to:
;output_handler =

Changed to:
output_handler =ob_gzhandler

Saved.. then tested my site. gzip is now on.

Should also mention: this enables gzip on the SERVER. So if you're running phpbb (who has it enabled via script), you have to disable their gzip to get rid of the warning.