0

I installed PHP 5.6.17 on a CentOS 6.4 server using this guide. A Contao installation is running on that server. Contao comes with these directives in its default .htaccess:

##
# Gzip compression
# @see https://github.com/h5bp/html5-boilerplate
##
<IfModule mod_deflate.c>
  <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
    AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
  </IfModule>
</IfModule>

This enables the automatic Gzip compression. However, on that server I noticed that the mod_filter extension wasn't enabled by default, even though it should be part of the php56w-common package (see https://webtatic.com/packages/php56/). I did notice that there is a mod_ext_filter extension enabled though - I changed my directives accordingly (replacing mod_filter with mod_ext_filter) which seems to work.

I never saw mod_ext_filter before so I am wondering what's the exact difference between these two modules (and why the more common (?) mod_filter module wasn't available in the php56w-common package for CentOS).

Community
  • 1
  • 1
fritzmg
  • 2,494
  • 3
  • 21
  • 51

1 Answers1

1

"I changed my directives accordingly (replacing mod_filter with mod_ext_filter) which seems to work." I can't imagine what this possibly means, but the two modules use completely different directives and serve different purposes. mod_ext_filter allows you to write your filters in an external script of your choosing. mod_filter runs filters loaded from a compiled module.

Apache Module mod_filter

Description: Context-sensitive smart filter configuration module

https://httpd.apache.org/docs/2.2/mod/mod_filter.html

Apache Module mod_ext_filter

Description: Pass the response body through an external program before delivery to the client

https://httpd.apache.org/docs/2.2/mod/mod_ext_filter.html

If – as I suspect – you aren't using either module, why load them at all?

Edit: Are you referring to the PHP filtering module? If so, that's been built in to PHP since forever. Run php -m | grep filter to see it listed for yourself.

Community
  • 1
  • 1
miken32
  • 42,008
  • 16
  • 111
  • 154
  • Sorry, I added more information to the original post. I see, so `mod_ext_filter` is not the same as `mod_filter` at all. Weirdly enough, even though `mod_filter` is not loaded (according to `phpinfo()` and seeing as the Gzip compressions is not enabled due to the `` directive), the `AddOutputFilterByType DEFLATE …` directives do still work. How can that be? – fritzmg Jan 29 '16 at 08:27
  • It turns out the server in question was running an older Apache version, where `mod_filter` is integrated and thus not available as a module. That's why it worked. – fritzmg Feb 26 '16 at 16:42