ob_gzhandler always conflicts with zlib.output_compression
| Bug #55544 | ob_gzhandler always conflicts with zlib.output_compression | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2011-08-31 02:58 UTC | Modified: | 2012-07-24 06:55 UTC |
|
||||||||||
| From: | diogin at gmail dot com | Assigned: | laruence (profile) | |||||||||||
| Status: | Closed | Package: | Output Control | |||||||||||
| PHP Version: | 5.4.0alpha3 | OS: | Windows XP SP3 x86 | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[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.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2011-09-19 14:19 UTC] mike@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: mike
[2011-09-19 14:37 UTC] mike@php.net
-Status: Assigned +Status: Closed
[2012-04-13 10:25 UTC] jacky at prahec dot com
[2012-06-11 22:36 UTC] php at pointpro dot nl
[2012-06-22 13:35 UTC] ewal at pointpro dot nl
[2012-07-02 07:26 UTC] dietmar at gps-tour dot info
[2012-07-17 14:15 UTC] bugs dot php at mohiva dot com
[2012-07-20 08:55 UTC] webmaster at abyssunderground dot co dot uk
[2012-07-20 17:08 UTC] rasmus@php.net
-Status: Closed +Status: Re-Opened
[2012-07-20 17:08 UTC] rasmus@php.net
Yes, something isn't being reset after the request when you use ob_start('ob_gzhandler')[2012-07-20 17:23 UTC] laruence@php.net
-Assigned To: mike +Assigned To: laruence
[2012-07-23 14:23 UTC] bugs dot php at mohiva dot com
[2012-07-24 02:44 UTC] laruence@php.net
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/html[2012-07-24 03:33 UTC] laruence@php.net
[2012-07-24 05:12 UTC] laruence@php.net
Here 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[2012-07-24 06:17 UTC] laruence@php.net
[2012-07-24 12:22 UTC] bugs dot php at mohiva dot com
[2012-07-29 11:36 UTC] knorge at gmx dot de
[2013-04-21 10:12 UTC] sweet_philippe at hotmail dot com
[2016-03-29 00:29 UTC] welfordmartin at gmail dot com
[2016-05-31 17:16 UTC] harrie_xo at yahoo dot co dot id
[2020-09-21 19:56 UTC] stefan dot coetzee at gmail dot com