PHP 4.0 Bug #6481 Updated: Gzcompress

From: Date: Sun, 24 Sep 2000 02:21:29 +0000
Subject: PHP 4.0 Bug #6481 Updated: Gzcompress
Groups: php.dev 
Request: Send a blank email to php-dev+get-33679@lists.php.net to get a copy of this message
ID: 6481 Updated by: stas Reported By: wico@cnh.nl Status: Closed Bug Type: *Zlib related Assigned To: Comments: I guess you should use gzopen("php://stdout","w") instead, because gzcompress doesn't have all gzip file headers too. In other words, gzcompress and gzopen/gzwrite are different functions, and in zlib too. Previous Comments: --------------------------------------------------------------------------- [2000-09-20 16:11:52] wico@cnh.nl Move to the rigth bug section P.S. can someone please take a look a this bug, my programm depends on it Greetz, Wico --------------------------------------------------------------------------- [2000-09-20 16:08:40] wico@cnh.nl Subject: gzcompress() broken To: wico@cnh.nl I was checking out http://bugs.php.net/bugs.php?id=6481 and found out why you are right. :-) The rest of the functions in the zlib section all use gzip compression. gzcompress() and gzuncompress() do not -- they use a deflate style compression, if I remember right. To fix it, you need to edit the zlib files in PHP to call the correct zlib function. It would be nice if you added this information for me (I have no desire to make a PHP bug reporting account) and if you moved it to the zlib section instead of a general question. -- Tyler Akins tyler@boas.anthro.mnsu.edu --------------------------------------------------------------------------- [2000-09-04 03:33:49] wico@cnh.nl Hiya As i allready said in my email thats a typo. This works: function Compress ($data) { $fp = fopen("/tmp/tempje", "w"); fputs($fp, $data); fclose($fp); $data2 = cat /tmp/tempje |/usr/bin/gzip -f; Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } this doesn't: function Compress ($data) { $data = gzcompress($data); Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data); } --------------------------------------------------------------------------- [2000-09-03 06:02:23] stas@php.net That's easy - you don't define data2 in second function. --------------------------------------------------------------------------- [2000-09-01 11:07:03] wico@cnh.nl Hiya I want to compress webpages for clients that support it $data is a whole html page but: This works: function Compress ($data) { $fp = fopen("/tmp/tempje", "w"); fputs($fp, $data); fclose($fp); $data2 = cat /tmp/tempje |/usr/bin/gzip -f; */ Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } this doesn't: function Compress ($data) { $data = gzcompress($data); Header("Content-Type: text/html"); Header("Content-Encoding: gzip"); echo($data2); } Anyone can explain this? Greetz, Wico --------------------------------------------------------------------------- The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online. Full Bug description available at: http://bugs.php.net/?id=6481

« previous php.dev (#33679) next »