From: petrich at tronic-media dot com Operating system: Linux (Kernel 2.4.20) PHP version: 4.3.4RC1 PHP Bug Type: Output Control Bug description: ob_start("ob_gzhandler") in combination with flush(): wrong HTTP header output?
Description: ------------ Hi, if using ob_start("ob_gzhandler") in combination with flush() it seems php send wrong HTTP header to the Browser (see Reproduce code). Thank you Hans-Jürgen Petrich Tested with Linux OS (Kernel 2.4.20) Apache2 (2.0.47) PHP 4.3.4RC1 (as Apache2 Handler) './configure' '--with-mysql=/usr' '--with-zlib' '--with-apxs2' default php.ini-dist is used Reproduce code: --------------- <?php ob_start("ob_gzhandler"); //header('Content-Encoding: gzip'); //header('Vary: Accept-Encoding'); ?> <html> <body> <p>This should be a compressed page. <? flush();?> </html> <body> Expected result: ---------------- HTTP/1.1 200 OK Date: Sat, 11 Oct 2003 16:53:06 GMT Server: Apache/2.0.47 (Unix) mod_ssl/2.0.47 OpenSSL/0.9.6b DAV/2 PHP/4.3.4RC1 X-Powered-By: PHP/4.3.4RC1 Content-Encoding: gzip Vary: Accept-Encoding Connection: close Content-Type: text/html; charset=ISO-8859-1 Actual result: -------------- HTTP/1.1 200 OK Date: Sat, 11 Oct 2003 16:53:36 GMT Server: Apache/2.0.47 (Unix) mod_ssl/2.0.47 OpenSSL/0.9.6b DAV/2 PHP/4.3.4RC1 X-Powered-By: PHP/4.3.4RC1 Connection: close Content-Type: text/html; charset=ISO-8859-1 -- Edit bug report at http://bugs.php.net/?id=25840&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25840&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25840&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25840&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25840&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25840&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25840&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25840&r=support Expected behavior: http://bugs.php.net/fix.php?id=25840&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25840&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25840&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25840&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25840&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25840&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25840&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25840&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=25840&r=float