PDA

View Full Version : PHP "Content-Encoding: gzip" in ispconfig web — how?


make-fun
23rd April 2008, 05:57
Hi folks

I just came across a weird behavior — I don't seem to be able using the PHP ob_start("ob_gzhandler"); for compressing the output.

When throwing in a file like
<?php
ob_start("ob_gzhandler");
phpinfo();
?>
in /home/admispconfig/ispconfig/web/test.php
it results in
HTTP_ACCEPT_ENCODING gzip,deflateBut
Response Headers:

Date: Wed, 23 Apr 2008 02:08:43 GMT
Server: Apache
X-Powered-By: PHP/5.2.5
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html

200 OK
When I put the same file in a normal user web it results in
HTTP_ACCEPT_ENCODING gzip,deflate

Response Headers:
Date: Wed, 23 Apr 2008 02:08:25 GMT
Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a
X-Powered-By: PHP/5.1.2
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

200 OKSo here it does work as supposed.

For the admin panel it does not bother me too much, but when using Roundcube webmail it would be a great improvement, of course.
They try to use it when supported with this function:// set output buffering
if ($_action != 'get' && $_action != 'viewsource')
{
// use gzip compression if supported
if (function_exists('ob_gzhandler')
&& !ini_get('zlib.output_compression')
&& ini_get('output_handler') != 'ob_gzhandler')
{
ob_start('ob_gzhandler');
}
else
ob_start();
}
But have no luck here :(

Any ideas/help on that?
Thanks

till
23rd April 2008, 10:27
The ISPConfig PHP on port 81 has no gzip support compiled in.

make-fun
23rd April 2008, 11:09
Thanks Till
But hmmm, why do I get an ACCEPT-ENCODING gzip,deflatefrom the <?php
phpinfo();
?> :confused:

Cheers

falko
24th April 2008, 13:55
I think you'd have to build mod_gzip for ISPConfig's Apache.
http://www.howtoforge.com/linux_apache_mod_gzip_5