php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18095 browser cant read zlib compressed output
Submitted: 2002-07-01 15:16 UTC Modified: 2002-07-11 02:50 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bugzilla at cm51-210 dot liwest dot at Assigned:
Status: Closed Package: Zlib related
PHP Version: 4.0CVS-2002-07-01 OS: Linux 2.4.18
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugzilla at cm51-210 dot liwest dot at
New email:
PHP Version: OS:

 

 [2002-07-01 15:16 UTC] bugzilla at cm51-210 dot liwest dot at
if i compile with --with-zlib,
output is zlib compressed (can check if i download page and gunzip) but browser displays binary output. (maybe content-type is wrong ?)

zlib.output_compression is set to OFF (doesnt help)

if i set zlib.output_compression_level = 0

output is readable, but prefixed with binary data

?4(??<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

you can check by yourself:

http://cm51-210.liwest.at/wiki/index.php?pagename=LinzCam

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-01 15:20 UTC] bugzilla at cm51-210 dot liwest dot at
i think the compressed data is the gzlib "dont compress, store only" header.

browser is mozilla 1.1 cvs
doesnt work with ie 6.0 either
 [2002-07-01 16:33 UTC] sr@php.net
If you use 0 as zlib.ouput_compression_level, the output isn't compressed, but the gzip/deflate headers are added to the output (and the corresponding Content-Encoding header).

Can you check with a phpinfo()-page that zlib.output_compression really is set to "off" (otherwise try setting it to "0")?

I can't reproduce the binary display with your example URL, it works with Mozilla 1.0 and lynx, if I make the HTTP by hand, it displays the correct headers.
 [2002-07-02 04:24 UTC] bugzilla at cm51-210 dot liwest dot at
zlib.output_compression Off
zlib.output_compression_level 0
(http://cm51-210.liwest.at/info/) -> faulty gzheader is generated


setting output compression to "0" & restarting -> 

in phpinfo, output compression stays "off", 
gzheader is generated again :-(

i dont think that the correct content encoding header is generated ... trying to test that via netcat
 [2002-07-02 05:20 UTC] bugzilla at cm51-210 dot liwest dot at
did a little debugging with socat:

request:

> GET /wiki/index.php?pagename=RecentChanges HTTP/1.1\r
> Host: cm51-210.liwest.at:91\r
> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a+) Gecko/20020624\r
> Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text
/css,*/*;q=0.1\r
> Accept-Language: en-us, en;q=0.50\r
> Accept-Encoding: gzip, deflate, compress;q=0.9\r
> Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66\r
> Keep-Alive: 300\r
> Connection: keep-alive\r

response:

< HTTP/1.1 200 OK\r
< Date: Tue, 02 Jul 2002 11:13:10 GMT\r
< Server: Apache/2.0.40-dev (Unix) mod_ssl/2.0.40-dev OpenSSL/0.9.6b PHP/4.3.0-dev\r
< Accept-Ranges: bytes\r
< X-Powered-By: PHP/4.3.0-dev\r
< Set-Cookie: PHPSESSID=974cec260ca6ac776ff114bf0a1e2f08; path=/\r
< Set-Cookie: WIKI_PREFS2=O%3A15%3A%22userpreferences%22%3A1%3A%7Bs%3A6%3A%22_prefs%22%3Ba%3A0%3A%7B%7D%7D; expires=Wed, 02-Jul-03 11:13:10 GMT
; path=/\r
< Last-Modified: Sat, 29 Jun 2002 10:19:44 +0000\r
< Transfer-Encoding: chunked\r
< Content-Type: text/html; charset=iso-8859-1\r
< \r
< 3661\r
< ..\b........@6..<?xml version="1.0" encoding="iso-8859-1"?>
< <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< <html xmlns="http://www.w3.org/1999/xhtml">
< <head>

for other pages i get

< HTTP/1.1 200 OK\r
< Date: Tue, 02 Jul 2002 11:16:39 GMT\r
< Server: Apache/2.0.40-dev (Unix) mod_ssl/2.0.40-dev OpenSSL/0.9.6b PHP/4.3.0-dev\r
< Accept-Ranges: bytes\r
< X-Powered-By: PHP/4.3.0-dev\r
< Set-Cookie: WIKI_PREFS2=O%3A15%3A%22userpreferences%22%3A1%3A%7Bs%3A6%3A%22_prefs%22%3Ba%3A0%3A%7B%7D%7D; expires=Wed, 02-Jul-03 11:16:39 GMT
; path=/\r
< Content-Encoding: gzip\r
< Vary: Accept-Encoding\r
< Content-Length: 12914\r
< Content-Type: text/html; charset=iso-8859-1\r
< \r
< ..\b........Q2..<?xml version="1.0" encoding="iso-8859-1"?>
< <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< <html xmlns="http://www.w3.org/1999/xhtml">
< <head>


Transfer-Encoding / Content-Encoding ????
 [2002-07-02 05:24 UTC] bugzilla at cm51-210 dot liwest dot at
looks like 

Content-Encoding: gzip

is missing for some pages (?)
 [2002-07-02 13:43 UTC] sr@php.net
It seems that there are two issues:

1.) Why isn't zlib.output_compression = Off active?
How do you set this? Via Apache-Config or php.ini? ini_set doesn't work for this option, please try setting it in php.ini, maybe there are some things wrong with the Apache2 config handling.

2.) Why does the Content-Encoding-Header vanish if chunked transfer encoding is used by Apache? Maybe this is an Apache 2 issue, too. Is it possible that you try this with Apache 1.3.26 so that we can localize this bug (if it's an Apache 2 thing or a general zlib bug)?

Thank you!

 [2002-07-11 02:50 UTC] bugzilla at cm51-210 dot liwest dot at
found out that this is a phpWiki bug. they do something 
like: 
 
        if (function_exists('ob_gzhandler')) { 
            ob_start('ob_gzhandler'); 
            $this->_is_compressing_output = true; 
        } 
 
which is imho really bad :-) 
 
thanks anyway for helping me finding the bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 14:01:27 2024 UTC