Bug #17603 Updated: ini_set can't disable zlib

From: Date: Tue, 18 Jun 2002 10:17:27 +0000
Subject: Bug #17603 Updated: ini_set can't disable zlib
References: 1  Groups: php.bugs php.doc 
Request: Send a blank email to php-bugs+get-11104@lists.php.net to get a copy of this message
ID: 17603 Updated by: cortesi@php.net Reported By: anon-php@sitefoundry.com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: RH 7.2 PHP Version: 4.2.1 New Comment: This bug has been fixed in CVS. You can grab a snapshot of the CVS version at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites. Thank you for the report, and for helping us make PHP better. changed value from "PHP_INI_ALL" to "PHP_INI_SYSTEM|PHP_INI_PERDIR" for "zlib.output_compression" Previous Comments: ------------------------------------------------------------------------ [2002-06-05 10:07:53] anon-php@sitefoundry.com Thanks for the suggestion. I regret to report that I can't make it work: no number of calls to flush(), ob_end_clean(), or ob_implicit_flush() allow the script to output non-compressed data. So, this comment: "If you disable it in your script after it has been started it won't be stopped." actually seems to mean "It is not possible to disable zlib output compression or buffering within a script." IMO this would be useful to note on the manual page for ini_set(). ------------------------------------------------------------------------ [2002-06-05 06:21:20] sander@php.net This is quite logical because the output compression starts before your script is executed. If you disable it in your script after it has been started it won't be stopped. You can _try_ a couple of ob_end_clean()'s (use ob_get_level() to find out how many) to stop it. Reopening as a documentation problem. ------------------------------------------------------------------------ [2002-06-04 20:33:40] anon-php@sitefoundry.com I have the following line in my php.ini: zlib.output_compression = On In experimenting with this, I attempted to disable it within a script (mostly because I wanted to defeat the output buffering that zlib performs). I tried several variations of this line in a script: ini_set('zlib.output_compression', '0'); ini_set('zlib.output_compression', 0); ini_set('zlib.output_compression', 'off'); In all cases, output is still compressed. Here is a complete script: <? ini_set('zlib.output_compression', '0'); echo "If compression is disabled, you should be able to read this via 'lynx -mime_header'"; ?> You can see it here: http://sitefoundry.com/php/zlib.html I get this output: HTTP/1.1 200 OK Date: Wed, 05 Jun 2002 00:30:51 GMT Server: Apache/1.3.22 Content-Encoding: gzip Connection: close Content-Type: text/html [non-ascii junk here] Here is my configure line: ./configure --with-apache=/usr/local/src/apache_1.3.22 --with-gd=/usr/local --with-imap --with-mysql=/usr/local/mysql --with-config-file-path=/usr/local/apache/conf --enable-debug=no --enable-track-vars=yes --with-zlib --enable-calendar ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17603&edit=1

« previous php.bugs (#11104) next »