[Pmwiki-users] Suggestion for the sample-config.php

Thomas -Balu- Walter list+pmwiki-users
Thu Mar 18 18:50:40 CST 2004


On Thu, Mar 18, 2004 at 05:47:02PM -0700, Patrick R. Michaud wrote:
> The php.net site says that the preferred mechanism for producing
> compressed output is to use the ini.zlib.compressed_output configuration
> directive, which alleviates the latency issue (compressed output is
> generated "on the fly").  Unfortunately, it doesn't appear to be possible
> to enable this directive from within a PHP script--it has to be done from
> a PHP configuration file or a .htaccess file.

Hm. The PHP manual has two different opinions on this?

http://de.php.net/manual/en/function.ini-set.php:
zlib.output_compression "0" PHP_INI_SYSTEM|PHP_INI_PERDIR

http://de.php.net/manual/en/ref.zlib.php
zlib.output_compression "Off" PHP_INI_ALL

It is also being described a little wierd:
"Whether to transparently compress pages. If this option is set to "On"
in php.ini or the Apache configuration, pages are compressed if the
browser sends an "Accept-Encoding: gzip" or "deflate" header.
"Content-Encoding: gzip" (respectively "deflate") and "Vary:
Accept-Encoding" headers are added to the output."

This means to me, that it has to be set in php.ini or the Apache
configuration, but

"You can use ini_set() to disable this in your script if the headers
aren't already sent. If you output a "Content-Type: image/" header the
compression is disabled, too (in order to circumvent a Netscape bug).
You can reenable it, if you add "ini_set('zlib.output_compression',
'On')" after the header call which added the image content-type."

then again tells me I can disable and enable this in the script?

Perhaps we should ask someone more into this (from the PHP developers)?

I'd also like to vote against enabling this per defaulft. It might
interfere with other settings e.g. if the webserver already has support
for mod_gzip, etc. (perhaps mod_gzip handles this nicely - I just don't
know enough about it)

     Balu



More information about the pmwiki-users mailing list