I tried this over on vbulletin.org, Dean answered, but his answer was for another question, I think.
I ran into problems with file downloading code on a site that had set zlib.output_compression=on and was using php version 4.3.4. The user got garbage on the screen, which was presumably due to compressed material not being uncompressed or vice versa.
The cryptic comment from his local expert was that
How does one write a script that is safe against zlib.output_compression being "on"?
This is what I've tried, seemingly successfully, but I've no idea if this is adequate, failsafe, etc.
Anyone got any thoughts on this?
I ran into problems with file downloading code on a site that had set zlib.output_compression=on and was using php version 4.3.4. The user got garbage on the screen, which was presumably due to compressed material not being uncompressed or vice versa.
The cryptic comment from his local expert was that
In php.ini I changed the line
zlib.output_compression = On
to
zlib.output_compression = Off
I have found better performance from php websites having it on. Most sites check to see if php has it on to avoid the problem, but it seems this software doesn't.
zlib.output_compression = On
to
zlib.output_compression = Off
I have found better performance from php websites having it on. Most sites check to see if php has it on to avoid the problem, but it seems this software doesn't.
This is what I've tried, seemingly successfully, but I've no idea if this is adequate, failsafe, etc.
PHP Code:
// Guard against uncontrolled use of zlib library
$zlib = ini_get('zlib.output_compression');
ini_set('zlib.output_compression', 'Off');
headers...
download..
// Restore setting of zlib library
ini_set('zlib.output_compression', $zlib);
Comment