Announcement

Collapse
No announcement yet.

Still don't understand how to implement gzip

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kier
    replied
    Originally posted by Shaman
    Don't go through all that CRAP!!!!

    Just put this in your php.ini file:

    output_handler = ob_gzhandler

    Done! All PHP output is thereafter compressed.
    I've tried using the output_handler = ob_gzhandler option on three separate servers now, one running IIS5 under Win2000, one running Apache 1.3.17 under Win2000, and one running Apache 1.3.14 under Redhat 6. All are running with the very latest version of PHP (4.04pl1) and have zlib built in...

    All of them crash or serve junk when including that line in the php.ini file. In the end I gave up and wrote a script that would do the same job. (here)

    Any thoughts on why the ~!^$& output_handler=ob_gzhandler line kills the server?

    [edit] - i've now discovered the problem - I was running PHP4.04, but not 4.04PL1, and it would seem that the older version has a nasty little bug that prevents the output handler from working... doh... more compiling to do now then...[/edit]
    Last edited by Kier; Sun 4th Feb '01, 10:33pm.

    Leave a comment:


  • Brian
    replied
    Or put <?php ob_start(ob_gzhandler); ?> in the top of your php file

    Leave a comment:


  • Rickard
    replied
    I like the sound of that last post! Thanks.

    Leave a comment:


  • Shaman
    replied
    Don't go through all that CRAP!!!!

    Just put this in your php.ini file:

    output_handler = ob_gzhandler

    Done! All PHP output is thereafter compressed.

    Leave a comment:


  • JohnM
    replied
    http://www.phpbuilder.com/columns/argerich20010125.php3

    Leave a comment:


  • Rickard
    replied
    Maybe I'm just really, really stupid, but I can't figure out what to do with gzcompress(). It deflates a string. Why would I want to do that?

    The help sais "See gzencode() for gzip compression", but there is no such function declared in the help.

    Please help me with this. I'm going out of my mind!!!

    Leave a comment:


  • Mike Sullivan
    replied
    Can't you guys leave a straight answer? Dennis Wrenn posted and gave me a link to the PHP manual and the "Zlib Compression Functions", but when I look at that page it only appears to be functions for reading and writing to gzipped files on the server. What am I missing here?
    I'm staring at the code now, and yet what I say isn't a straight answer? Ooookkk...

    You missed a function:
    http://www.php.net/manual/en/html/fu...zcompress.html

    Leave a comment:


  • Rickard
    replied
    Oh, come on! Can't you guys leave a straight answer? Dennis Wrenn posted and gave me a link to the PHP manual and the "Zlib Compression Functions", but when I look at that page it only appears to be functions for reading and writing to gzipped files on the server. What am I missing here?

    Do I need to make any additions to my current php code or is the gzipping completely transparent if I install zlib?

    If zlib requires code additions, howcome mod_gzip doesn't?

    The PHP 4.0.4 changelog sais "Added transparent gzip compression support.". What does that mean? That PHP now can read/write gzipped files on the server without any modules and stuff? That PHP can make use of zlib- or mod_gzip-compression of webserver output without any extra code?

    "Note: The current CVS version 4.0.4-dev introduces a fopen-wrapper for .gz-files, so that you can use a special 'zlib:' URL to access compressed files transparently using the normal f*() file access functions if you prepend the filename or path with a 'zlib:' prefix when calling fopen().".
    Am I the only one that doesn't quite get that?

    [Edited by Rickard on 01-24-2001 at 09:54 PM]

    Leave a comment:


  • JohnM
    replied
    No no no, it gzips the OUTPUT it sends to the browser, which is then unzipped by IE(/Netscape?) and displayed.

    Leave a comment:


  • Rickard
    replied
    Ok, now I get it, but why would vBulletin benefit from being able to read and write to gzipped files?

    Leave a comment:


  • Shaman
    replied
    Check your php.ini and do this:

    output_handler = ob_gzhandler

    It's working for me. It only does files that go through PHP, however.

    Forward problems to /dev/null, please. This is working for me, YMMV.

    Leave a comment:


  • MattR
    replied
    Originally posted by Ed Sullivan
    mod_gzip only works with static HTML.
    zLib works with dynamic PHP pages.
    Actually the latest version of mod_gzip is *supposed* to work with PHP.

    I say supposed because I have it installed and all it has done is break my image links. grr.

    NEW mod_gzip v 1.3.14.6e - 12/04/00 that can compress both STATIC and DYNAMIC output for both external CGI and 'mod_xxxx' Apache module output is now available.

    Leave a comment:


  • Mike Sullivan
    replied
    mod_gzip only works with static HTML.
    zLib works with dynamic PHP pages.

    Leave a comment:


  • fastforward
    replied
    VB 2 uses what Ed was talking about. NOT mod_gzip.

    Leave a comment:


  • Rickard
    replied
    I do mean the mod_gzip for Apache and I do believe that I am in the right forum. I wanted to know if there were any code-changes that had to be done. I read somewhere that vBulletin 2.0 supported this feature and I wondered why only vB 2 supported it if it didn't require any code changes.

    Leave a comment:

widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X