输出过滤器在Linux / apache2下无法运行

I want to use mod_ext_filter / ExtFilterDefine / SetOutputFilter on linux, apache2, php.

I have enabled mod_ext_filter module and add these lines to apache2.conf:

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

SetOutputFilter my_filter_name

I have tried these simple stuff in my_filter.php:

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

None of them works and I get empty html pages in the browser when I call a simple html or php file.

error.log shows nothing.

All these are work under Windows.

The system is:
Ubuntu 14.04.1
Apache/2.4.7
PHP 5.5.9

If I delete this line:

SetOutputFilter my_filter_name

Then pages work correctly.

What is the problem here? Why it is working under Windows and is not under Linux?

I think there is some misconfiguration but I can't find it.

I'm answering my own question: If I change this:

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

to:

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

then it works.