|  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: None
 [2006-01-09 01:17 UTC] sBoisvert at bryxal dot ca
This has either not been fixed or crept back in. (Bug #17299)

The documentation on

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);

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-09 15:00 UTC]
php_enable_output_compression() is called only in PHP_RINIT_FUNCTION() and not in OnUpdate_zlib_output_compression().
 [2006-04-15 21:29 UTC]
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:
 [2006-05-24 11:48 UTC]
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]
Is there a reason to not be able to *enable* the output compression from runtime?
 [2007-08-20 14:45 UTC]
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]
Automatic comment from SVN on behalf of jani
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]
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-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 09 03:03:40 2023 UTC