简体   繁体   English

mod_ext_filter和mod_filter之间的区别?

[英]Difference between mod_ext_filter and mod_filter?

I installed PHP 5.6.17 on a CentOS 6.4 server using this guide. 我使用指南在CentOS 6.4服务器上安装了PHP 5.6.17 A Contao installation is running on that server. 该服务器上正在运行Contao安装。 Contao comes with these directives in its default .htaccess: Contao在其默认.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. 这将启用自动Gzip压缩。 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/ ). 但是,在该服务器上,我注意到默认情况下未启用mod_filter扩展,即使它应该是php56w-common软件包的一部分(请参阅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. 我确实注意到,尽管启用了mod_ext_filter扩展-我相应地更改了指令(用mod_ext_filter替换了mod_filter ),这似乎可行。

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). 我之前从未见过mod_ext_filter ,所以我想知道这两个模块之间的确切区别是什么(为什么CentOS的php56w-common软件包中没有更常见的(?) mod_filter模块)。

"I changed my directives accordingly (replacing mod_filter with mod_ext_filter) which seems to work." “我相应地更改了指令(用mod_ext_filter替换mod_filter)似乎可行。” 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_ext_filter允许您在选择的外部脚本中编写过滤器。 mod_filter runs filters loaded from a compiled module. mod_filter运行从已编译模块加载的过滤器。

Apache Module mod_filter Apache模块mod_filter

Description: Context-sensitive smart filter configuration module 说明:上下文相关的智能过滤器配置模块

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

Apache Module mod_ext_filter Apache模块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 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? 编辑:您指的是PHP过滤模块? If so, that's been built in to PHP since forever. 如果是这样,那将永远是PHP内置的。 Run php -m | grep filter 运行php -m | grep filter php -m | grep filter to see it listed for yourself. php -m | grep filter可以查看列出的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM