Edit report at https://bugs.php.net/bug.php?id=63836&edit=1
ID: 63836 Updated by: a...@php.net Reported by: if-post at ifinterface dot com Summary: Don't work ob_gzhandler -Status: Open +Status: Not a bug Type: Bug Package: *Web Server problem Operating System: Windows XPx32 SP3 PHP Version: 5.4.10 Block user comment: N Private report: N New Comment: You shouldn't send the content-length header. Just comment it out in your snippet and you'll get $ curl -v --compress http://localhost:8080/bug63836.php * About to connect() to localhost port 8080 (#0) * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 8080 (#0) > GET /bug63836.php HTTP/1.1 > User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r > zlib/1.2.3 > Host: localhost:8080 > Accept: */* > Accept-Encoding: deflate, gzip > < HTTP/1.1 200 OK < Date: Fri, 28 Dec 2012 10:36:58 GMT < Server: Apache/2.2.22 (Win32) PHP/5.4.11-dev < X-Powered-By: PHP/5.4.11-dev < Content-Encoding: gzip < Vary: Accept-Encoding < Content-Length: 46 < Content-Type: text/html < Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata...* Connection #0 to host localhost left intact * Closing connection #0 And, that's definitely wrong setting the content-length to the length of the uncompressed data. Previous Comments: ------------------------------------------------------------------------ [2012-12-22 17:56:03] if-post at ifinterface dot com Description: ------------ PHP 5.4.10 Windows XPx32 SP3 Apache/2.2.22 VC9 Don't work ob_gzhandler in ob_start('ob_gzhandler'); I don't receive header=Content-Encoding: gzip (realy don't zip) when I specify header=Content-Length: On Ubuntu 12.04x64 (Apache/2.2.22 PHP 5.4.9) - all ok! On Windows XPx32 (Apache/2.2.22 VC9 PHP 5.3) - all ok! Test script: --------------- <?php function fnecho($a){ ob_start('ob_gzhandler'); header("Content-Length: ".strlen($a));//to was without chunks echo $a; ob_end_flush(); } fnecho("Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata... Anything... Tra-tata..."); ?> Expected result: ---------------- header=Content-Encoding: gzip Actual result: -------------- Nothing = no zip. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63836&edit=1