|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-08-31 02:58 UTC] diogin at gmail dot com
Description:
------------
Windows XP SP3 x86, Apache 2.2, PHP 5.4.0alpha3, with the following php.ini configuration options:
output_buffering = Off
zlib.output_compression = Off
Run this script twice through browser, you will see a warning and a notice:
<?php
ob_start('ob_gzhandler');
echo 'hello, world';
ob_end_flush();
?>
And the error messages are:
Warning: ob_start() [ref.outcontrol]: output handler 'ob_gzhandler' conflicts with 'zlib output compression' in D:\soft\develop\web\php\5.4\0\var\index.php on line 2
Notice: ob_start() [ref.outcontrol]: failed to create buffer in D:\soft\develop\web\php\5.4\0\var\index.php on line 2
hello, world
Test script:
---------------
<?php
ob_start('ob_gzhandler');
echo 'hello, world';
ob_end_flush();
?>
Expected result:
----------------
No warnings or notices will be raised.
Actual result:
--------------
A warning and a notice are raised.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
Yes, something isn't being reset after the request when you use ob_start('ob_gzhandler')I tested with php build server, didn't reproduce your issue. test script: <?php ob_start('ob_gzhandler'); echo 'hello, world'; ob_end_flush(); ?> server response: HTTP/1.1 200 OK Host: inf-dev-porsche.weibo.com:8964 Connection: close X-Powered-By: PHP/5.5.0-dev Content-Encoding: gzip Vary: Accept-Encoding Content-type: text/htmlHere is the problem ext/zlib/zlib.c @@ -205,7 +205,7 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o if (SUCCESS == php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_GET_FLAGS, &flags TSRMLS_CC)) { /* only run this once */ if (!(flags & PHP_OUTPUT_HANDLER_STARTED)) { if (SG(headers_sent) || !ZLIBG(output_compression)) { seems we need a bigger work to resolve this