php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48994 zlib.output_compression does not ouput HTTP headers when set to a string value
Submitted: 2009-07-21 02:48 UTC Modified: 2009-08-03 18:16 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jflatnes at vt dot edu Assigned: jani
Status: Closed Package: Zlib related
PHP Version: 5.2.10 OS: Linux 2.6.29
Private report: No CVE-ID:
 [2009-07-21 02:48 UTC] jflatnes at vt dot edu

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-21 18:46 UTC] jani@php.net
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.
 [2009-07-21 19:03 UTC] jflatnes at vt dot edu
<?php var_dump(ini_set('zlib.output_compression', 'On')); ?>

Results in:

string(0) "" (meaning I had no previous setting for zlib.output_compression, I believe)

---

I am coming to understand that the string 'On' doesn't behave the same way in ini_set as in an ini file, as mentioned.  The issue I see here is that there are two options for zlib compression:

zlib.output_compression = false: no compression with no headers.

zlib.output_compression = true: compression with appropriate headers.

Passing a string to ini_set (other than the string '1') causes a third, undocumented behavior:

zlib.output_compression = 'On': compression without the headers.

Those three states describe the behavior I'm seeing, and the third state seems like a bug.  If 'On' is an invalid setting, shouldn't the compression simply not be activated?  Am I thinking about this correctly?)
 [2009-07-21 22:50 UTC] jani@php.net
There is something weird going on here, verified it now. Need to 
investigate more tomorrow. To reproduce on command line:

# HTTP_ACCEPT_ENCODING=gzip gdb --arg php-cgi test.php
 [2009-07-29 01:13 UTC] apinstein at mac dot com
I ran into this issue today as well... but I have more to add.

Using PHP 5.3 + zlib 1.2.3

I *cannot* get compression + headers. I can get no compression, or 
compression 
w/o headers, but never "working" compression+headers.

I have tried:

httpd.conf:

 php_flag zlib.output_compression On
 php_admin_flag zlib.output_compression On
 -> zip + no headers

 php_flag zlib.output_compression true
 php_admin_flag zlib.output_compression true
 -> not zipped

In app.php:

 ini_set('zlib.output_compression', true);
 ini_set('zlib.output_compression', "On");
 -> not zipped
 [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
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-08-17 17:30 UTC] svn@php.net
Automatic comment from SVN on behalf of jani
Revision: http://svn.php.net/viewvc/?view=revision&revision=287423
Log: - Fixed bug #49248 by fixing bug #48994 properly
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 05:03:21 2014 UTC