[thelist] HTML Output Compression

J.J. SOLARI jjsolari at pobox.com
Sun Mar 6 14:53:25 CST 2005


Dejan Kozina <dejan at kozina.com> wrote:

Dejan,

>I'd go for a simpler solution.
>first add this to the .htaccess:
>'AddType application/x-httpd-php php .htm .html'
>this would send all your HTML files to PHP for processing. As long as
>they do not contain PHP code they'll be sent back to Apache as they are.
>Now, if PHP is installed as an Apache module you just add another line
>to .htaccess: 'php_flag zlib.output_compression on'.
>This should on transparent Zlib compression on everything that is output
>by PHP, including your HTML-only files.
>If this last line causes a 500 Server Error it means that PHP is
>installed as a CGI and you can't control it ffrom .htaccess. This is
>often the case on shared servers, when the admin forces separation
>between users with phpsuexec or something similar. The major part of
>such suexec programs allow you then to configure PHP on a per-directory
>basis putting a php.ini file in each folder. In this case just create a
>php.ini with the line 'zlib.output_compression=On' and you should be OK.

Simple indeed :-)
PHP is installed as a CGI, and the php.ini option is the way to go. I have not
tested thoroughly this solution, for example as to have only one php.ini file
in the parent directory. Whatever...

Thanks for your advice,

JJS.


More information about the thelist mailing list