This code is adapted from the reference script at zend.com, but with the addition of the ability to set the zip compression level. You can alter the line $gziplevel = 1; to use any number between 0-9 (0 is no compression), but i've found that for my site, a level of 1-3 gives the best balance of speed against CPU loading.
Once you have installed the code snippet, you can test that it's working by a) trying to access your forums b) inputting your URL here (you need to specify the .php file, rather than just the directory) http://leknor.com/code/gziped.php
Of course, you will need to have PHP built with zlib support for this to work. Find out by running a phpinfo() script...
If you have PHP 4.04pl1, and you want to just compress ALL php on your site, edit your php.ini file to read this:
output_handler = ob_gzhandler
Have to have PHP 4.04pl1, and compile it to use zlib...
Chris
Dosn't work for me, I just get a blank screen.
The Site is on Datablocks.net
If I set it to 1 it works
2 or above gives me a blank screen :(
wow! even with it set to 1, the difference was noticed
For me it doesn't work with 1 either... :(
Originally posted by -saturn-
For me it doesn't work with 1 either... :(
You're server must have php4 and zlib :D
I'm hosted at www.nomontlyfees.com
I know they have php4, but how can I find if they have zlib?
Easy! Go to yourdomain.com/forum/admin/index.php?action=phpinfo