Re: Re: #21139 [Ctl]: zlib.output_compression + windows failure

From: Date: Mon, 23 Dec 2002 18:13:30 +0000
Subject: Re: Re: #21139 [Ctl]: zlib.output_compression + windows failure
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-92791@lists.php.net to get a copy of this message
I have taken a short look at the code and i think Morioshi is correct. zlib_ouput_compression doesn't seem work when zlib si compiled as a shared module. But i will not have time for this until after x-mas. marcus At 09:11 23.12.2002, Moriyoshi Koizumi wrote:
As far as I've looked into this problem, absense of "Content-Encoding" field in the response headers, apparently a side effect of the patch of rev 1.138 for main/SAPI.c, results in un-inflated output on the clients. Because the patch was designed only to work with statically linked zlib module, it causes link failure on unix build and prevents part of the code responsible for sending the required headers from being compiled properly on Windows build (due to the lack of HAVE_ZLIB definition) in case the extension is built as shared. This was confirmed by comparing the browser outputs of the following two scripts. <?php /* script A (should give incorrect result) */ echo "test"; ?> <?php /* script B (should be OK) */ Header("Content-Encoding: gzip"); Header("Vary: Accept-Encoding"); echo "test"; ?> Besides this patch doesn't seem to accomplish its purpose completely, as there would be no way at all to stop output_compression once the output buffer is flushed either intentionally or automatically. <?php /* script C */ echo str_repeat("abcd", 1023); /* the next line actually switches off output compression */ ini_set('zlib.output_compression', 0); ?> <?php /* script D */ echo str_repeat("abcd", 1024); /* no way to stop output compression at this point */ ini_set('zlib.output_compression', 0); ?> Therefore I think the modified part should be reverted for now, unless there is a better way to fulfill the requirement (see bug #16109). BTW since when did I become a "output guy" ? :) Moriyoshi Wez Furlong <wez@thebrainroom.com> wrote: This needs one of you "output guys" to resolve it. Andrei mentioned something about making the final release before 1st Jan, so if you can, please get your coding-butts in gear :) --Wez. On 22 Dec 2002 moriyoshi@php.net wrote:
 ID:               21139
 Updated by:       moriyoshi@php.net
 Reported By:      helly@php.net
 Status:           Critical
 Bug Type:         Output Control
Operating System: Windows
 PHP Version:      4.3.0RC4
New Comment: Verified on Windows, with Apache or Apache2. -- HTTP response dump of the following script -- <?php echo "abcde"; ?> -- Apache_1.3.27 -- HTTP/1.1 200 OK Date: Sun, 22 Dec 2002 18:06:53 GMT Server: Apache/1.3.27 (Win32) PHP/4.4.0-dev X-Powered-By: PHP/4.4.0-dev Connection: close Content-Type: text/html (correctly gzip-encoded content) -- Apache_2.0.43 -- HTTP/1.1 200 OK Date: Sun, 22 Dec 2002 18:06:15 GMT Server: Apache/2.0.43 (Win32) PHP/4.4.0-dev Last-Modified: Sun, 22 Dec 2002 17:59:26 GMT ETag: "45a2-1b-e744bab1" Accept-Ranges: bytes Content-Length: 27 Connection: close Content-Type: application/x-httpd-php <br /> <b>Warning</b>: (null)() [<a href='http://www.php.net/ref.outcontrol'>ref.outcontrol</a>]: Cannot change zlib.output_compression - headers already sent in <b>Unknown</b> on line <b>0</b><br /> abcde Previous Comments: ------------------------------------------------------------------------ [2002-12-21 19:27:53] edink@php.net I can confirm this bug on Windows + Apache + zlib.output_compression in .htaccess. If zlib.output_compression is set to on from php.ini it works. It only doesn't work if set from .htaccess. ------------------------------------------------------------------------ [2002-12-21 17:48:30] helly@php.net I have just installed latest php 4.3 on linux and windows. I use the same directory and therefore .htaccess files for apache/mod_php on both platforms. When i enable enable output compression with ini setting
        php_value zlib.output_compression On
in .htaccess the linux version works as expected but the windows version fails. Sometimes i receive errors with access violations. Sometimes i can downlowd the result but when rename the resulting file to .gz i can open it and as you might expect it contains the correct result. And sometime i see the encoding result presented in the browser and then i cannot save and view it although the gzip header seems correct. marcus ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21139&edit=1
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.dev (#92791) next »