输出过滤器在Linux/apache2下不工作


Output filter not working under Linux/apache2

我想在linux, apache2, php上使用mod_ext_filter/ExtFilterDefine/SetOutputFilter

我已经启用了mod_ext_filter模块,并将这些行添加到apache2.conf:

ExtFilterDefine my_filter_name mode=output intype=text/html cmd="/var/www/html/test/my_filter.php"
SetOutputFilter my_filter_name

我在my_filter.php中尝试了这些简单的东西:

xyz

1)2) & lt;?php echo "xyz";?>
3) & lt;php readfile ?("php://stdin");?>

它们都不起作用,当我调用一个简单的html或php文件时,我在浏览器中得到空的html页面。

error.log无显示

所有这些都是在Windows下工作的。

系统是:
Ubuntu 14.04.1
Apache/2.4.7
PHP 5.5.9

如果我删除这一行:

SetOutputFilter my_filter_name

那么页面工作正常

这里有什么问题?为什么它在Windows下工作,而不是在Linux下?

我想是配置错误,但是我找不到。

我在回答自己的问题:如果我改变这个:

ExtFilterDefine my_filter_name mode=output intype=text/html '
                     cmd="/var/www/html/test/my_filter.php"

:

ExtFilterDefine my_filter_name mode=output intype=text/html '
       cmd="/usr/bin/php5 /var/www/html/test/my_filter.php"