ID:               48994
 Updated by:       j...@php.net
 Reported By:      jflatnes at vt dot edu
-Status:           Open
+Status:           Feedback
 Bug Type:         Zlib Related
 Operating System: Linux 2.6.29
 PHP Version:      5.2.10
 New Comment:

Try this too:

<?php

var_dump(ini_set('zlib.output_compression', 'On'));

?>

Also note that using "On" or "Off" or such with ini_set() does NOT work

like they do when used in php.ini.


Previous Comments:
------------------------------------------------------------------------

[2009-07-21 02:48:18] jflatnes at vt dot edu

Description:
------------
When the configuration option 'zlib.output_compression' is set to a
boolean value, output is compressed and the appropriate HTTP headers are
sent.  When the option is set to a string like 'true' or 'On', the
output is compressed, but no headers are sent, causing browsers to fail
to interpret the output as compressed.

Reproduce code:
---------------
<?php

ini_set('zlib.output_compression', 'On');

echo 'hello, world';

?>

Expected result:
----------------
The output "hello, world" to be gzip/deflate compressed as appropriate
for Accept-Encoding, and the Content-Encoding and Vary HTTP headers to
be set.

Actual result:
--------------
Instead, the output is indeed gzip-compressed, but the Content-Encoding
and Vary headers are not set.

The actual text that the browser prints is:

‹&#65533;&#65533;&#65533;&#65533;&#65533;&#65533;ÊHÍÉÉ×Q(Ï/ÊI&#65533;&#65533;&#65533;ÿÿ&#65533;:r«ÿ
&#65533;&#65533;&#65533;

Note, this works correctly with the an ini_set argument of the boolean
value true.  The documentation claims that ini_set should take string
arguments, though.  Even if a boolean/integer is required to activate
output compression, the behavior should either be "all on" or "all off".


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48994&edit=1

Reply via email to