Edit report at https://bugs.php.net/bug.php?id=55544&edit=1
ID: 55544 Updated by: [email protected] Reported by: diogin at gmail dot com Summary: ob_gzhandler always conflicts with zlib.output_compression Status: Re-Opened Type: Bug Package: Output Control Operating System: Windows XP SP3 x86 PHP Version: 5.4.0alpha3 Assigned To: laruence Block user comment: N Private report: N New Comment: here is the confusion(assuming -d output_handler=ob_gzhandler -d zlib.output_compression=0) : 1. php.output_handler will change the ZLIGB(output_compression) before the zlib RINIT 2. in zlib RINIT, we set the ZLIBG(output_compression) to default value(ini) 3. if we don't override the ZLIBG(output_compression), then in the php_zlib_output_compression_start which will be called in RINT will try to start zlib compression handler (although it depends on the requeset header), then, the conflict warning will be threw. 4. if we override it, then it the php_zlib_output_compression_start, it will return FALIURE, and no compression occurred(see the codes from my previous reply) so, the key problem is multi-featrues depends on one global flag -> ZLIBG(output_compression). Previous Comments: ------------------------------------------------------------------------ [2012-07-24 05:12:35] [email protected] 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 03:33:54] [email protected] oh, I mis-understand your codes, verified. ------------------------------------------------------------------------ [2012-07-24 02:44:01] [email protected] 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-23 14:23:12] bugs dot php at mohiva dot com The error message is gone, but the gzip compression doesn't work no longer. The configuration that I use in php-fpm.conf is: php_flag[output_buffering] = on php_flag[zlib.output_compression] = off php_value[output_handler] = ob_gzhandler Can someone of the devs mark the bug 62335 as duplicate. ------------------------------------------------------------------------ [2012-07-20 18:58:09] [email protected] Please try using this snapshot: http://snaps.php.net/php5.4-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Hi, I've made a fix for this, could you please try with it? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55544 -- Edit this bug report at https://bugs.php.net/bug.php?id=55544&edit=1
