php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #35936 ini.zlib.output-compression Documentation
Submitted: 2006-01-09 01:17 UTC Modified: 2009-08-03 18:16 UTC
From: sBoisvert at bryxal dot ca Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.1 OS: XP
Private report: No CVE-ID:
 [2006-01-09 01:17 UTC] sBoisvert at bryxal dot ca
Description:
------------
This has either not been fixed or crept back in. (Bug #17299)

The documentation on 

http://ca3.php.net/manual/en/ref.zlib.php#ini.zlib.output-compression

it states

zlib.output_compression  boolean/integer

 .... In runtime, it can be set only before sending any output. 

but any attempts to set 

ini_set("zlib.output_compression", "on");
ini_set("zlib.output_compression_level", 5);

will NOT compress data before sending it. Either this is a bug that slipped in lately or a documentation problem. 

A comment has already been left by someone on this page commenting on his inability to make this work.

Thank you

Reproduce code:
---------------
ini_set("zlib.output_compression", "on");
ini_set("zlib.output_compression_level", 5);
echo(ini_get("zlib.output_compression"));

Expected result:
----------------
compressed:
on

Actual result:
--------------
uncompressed:
on

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-09 15:00 UTC] vrana@php.net
php_enable_output_compression() is called only in PHP_RINIT_FUNCTION() and not in OnUpdate_zlib_output_compression().
 [2006-04-15 21:29 UTC] tony2001@php.net
Looks like the docs are wrong and this option is actually not PHP_INI_ALL, but PHP_INI_SYSTEM|PHP_INI_PERDIR.
This was accidentally changed with this patch:
http://cvs.php.net/viewcvs.cgi/php-src/ext/zlib/zlib.c?r1=1.136&r2=1.137
 [2006-05-24 11:48 UTC] mike@php.net
IIRC (and reading the code reveals that) it's possible to *disable* zlib.output_compression at runtime, which actually works fine here.

 [2007-08-20 12:36 UTC] vrana@php.net
Is there a reason to not be able to *enable* the output compression from runtime?
 [2007-08-20 14:45 UTC] jani@php.net
From reading the sources (always the best reference..):

156 	  	                 php_error(E_WARNING, "Cannot change zlib.output_compression buffer size during script execution");
157 	  	                 return FAILURE;

Vrana: Please, don't reclassify documentation issues before discussing on internals where lot more people than just me can see them..
 [2009-08-03 18:15 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=286751
Log: - Fixed bug #48994 (zlib.output_compression does not ouput HTTP headers when set to a string value)
# also fixes bug #35936 (ini.zlib.output-compression Documentation :)
 [2009-08-03 18:16 UTC] jani@php.net
There was a bug that caused "on" string to be treated wrong when used in a script via ini_set(). This is now fixed.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 17:01:58 2014 UTC