[Mod_gzip] mod_gzip und mod_php

Cosmin cosmin at leuvirtual.ro
Fri Apr 23 10:20:29 CEST 2004


Hello,
i am using apache2, on apache 2 the mod_gzip module is called mod_deflate
but i think they are the same. The configurations options in httpd.conf are
different but with the same options. You should try apache 2, faster and
better.

Regarding your problem i also have a Apache/1.3.28, mod_gzip/1.3.26.a,
PHP/4.3.3 which is manually installed from sources, not from packages.

my gzip configuration is :
=======================
LoadModule gzip_module modules/mod_gzip.so
...
other not related stuff here 
.....
LogFormat "%h %l %u %t \"%V %r\" %<s %b mod_gzip: %{mod_gzip_result}n
In:%{mod_gzip_input_size}n -< Out:%{mod_gzip_output_size}n =
%{mod_gzip_compression_ratio}n pct." common_with_mod_gzip_info2
....
CustomLog /install/www/logs/access_log common_with_mod_gzip_info2
......

 <IfModule mod_gzip.c>
mod_gzip_on                   Yes
mod_gzip_can_negotiate        Yes
mod_gzip_static_suffix        .gz
AddEncoding              gzip .gz
mod_gzip_update_static        No
mod_gzip_command_version      '/mod_gzip_status'
mod_gzip_keep_workfiles       No
mod_gzip_minimum_file_size    500
mod_gzip_maximum_file_size    500000
mod_gzip_maximum_inmem_size   60000
mod_gzip_min_http             1000
mod_gzip_handle_methods        GET POST
mod_gzip_item_include         mime       ^text/html$
mod_gzip_item_include         mime       ^text/plain$
mod_gzip_item_include         mime       ^httpd/unix-directory$
mod_gzip_item_include         file       \.html$
mod_gzip_item_exclude         file       \.js$
mod_gzip_item_exclude         file       \.css$
mod_gzip_item_include         file       \.pl$
mod_gzip_item_include         handler    ^cgi-script$
mod_gzip_item_include   file    \.php$
mod_gzip_dechunk              Yes

</IfModule>

======================
here is a paket sniff between my browser and the server:


GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-powerpoint,
application/vnd.ms-excel, application/msword, */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Host: 192.168.0.1
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Fri, 23 Apr 2004 07:05:12 GMT
Server: Apache/1.3.28 (Unix) mod_gzip/1.3.26.1a PHP/4.3.3
Vary: *
X-Powered-By: PHP/4.3.3
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
X-Pad: avoid browser bug
Content-Encoding: gzip
Content-Length: 2528

&#8249;      íZmo&Ucirc;8&thorn;\&yuml;
F¸6K~ÉKc[>´in&#8250;EÓ×Ü&#8225;&cent;(h&#8249;&para;&#8482;&#8220;%-E9N&ordm;&ugrave;&iuml;;C&frac12;ËRb'>\¸¨$93&Iuml;p&aelig;!Ey¸÷ö&atilde;&Ugrave;&Otilde;&iquest;>&#8220;wW&#8212;&iuml;ɧ&frac34;yqF´&#8211;a|é&AElig;&Ucirc;&laquo;&middot;&iexcl;&agrave;Pow&Egrave;&#8226;
Ž&Iuml;%w
j&AElig;&ugrave;mTÎ&aring;Â&AElig;&pound;\$&#8212;6éz&iquest;O&THORN;&sup3;&agrave;w.d at m&Ograve;&iuml;ëú&ETH;e&micro;á&#8218;IJ&aelig;Rz-öG&Agrave;&#8212;&brvbar;v&aelig;:&#8217;9&sup2;uuë1LÂ'S&#8220;l%
T? &#8220;9>&#8220;&÷ÝÖ&laquo;WG§­ ETC ....

so the output is compressed.

Please let me know if it works for you.

the diffrent things i noticed in my and your configs are: 

mod_gzip_item_include   file    \.php$ - on my config 

and mod_gzip_item_include file .php$ in yours.

Best regards.

--------- Mesaj Original --------
De la: Compression module for Apache <mod_gzip at lists.over.net>
pentru: mod_gzip at lists.over.net <mod_gzip at lists.over.net>
Subiect: [Mod_gzip] mod_gzip und mod_php
Data: 23/04/04 01:17

> Hello,
> 
> I've got a problem with mod_gzip. My PHP-files are not compressed. I've 
> searched for that problem in the internet but I doesn't find a solution.
> Server: Apache/1.3.27 (Linux/SuSE) mod_gzip/1.3.26.1a PHP/4.3.1
> 
> Can you help me?
> 
> Here is my mod_gzip configuration of my httpd.conf
> 
> mod_gzip_on Yes
> mod_gzip_temp_dir /tmp
> mod_gzip_keep_workfiles No
> mod_gzip_item_exclude file .js$
> mod_gzip_item_exclude file .css$
> mod_gzip_dechunk              Yes
> mod_gzip_command_version      '/mod_gzip_status'
> mod_gzip_send_vary            On
> mod_gzip_minimum_file_size 500
> mod_gzip_maximum_inmem_size 60000
> mod_gzip_item_include file .htm$
> mod_gzip_item_include file .html$
> mod_gzip_item_include mime text/.*
> mod_gzip_item_include file .pl$
> mod_gzip_item_include file .php$
> mod_gzip_item_include handler ^cgi-script$
> mod_gzip_item_include mime &quot;application/x-httpd-php&quot;
> LogFormat &quot;%h %l %u %t &quot;%V %r&quot; %&lt;s %b mod_gzip:
%{mod_gzip_result}n 
> In:%{mod_gzip_input_size}n -&lt; Out:%{mod_gzip_output_size}n = 
> %{mod_gzip_compression_ratio}n pct.&quot; common_with_mod_gzip_info2
> CustomLog /var/log/httpd/mod_gzip common_with_mod_gzip_info2
> 
> _______________________________________________
> mod_gzip mailing list
> mod_gzip at lists.over.net
> http://lists.over.net/mailman/listinfo/mod_gzip
> 



More information about the mod_gzip mailing list