2015-10-06 14 views
1

我想在linux,apache2,php上使用mod_ext_filter/ExtFilterDefine/SetOutputFilter。輸出過濾器不能在Linux/apache2下工作

我已經啓用mod_ext_filter模塊,並添加這些行到apache2.conf:

1)XYZ
2)< PHP:

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」; ? >
3)<?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下?

我認爲存在一些配置錯誤,但找不到它。

回答

0

我回答我的問題: 如果我改變了:

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" 

然後它工作。