apache设置为不允许任何文件在特定子目录内执行

我有一个用户需要上传图像的HTML / DOC根目录下的子目录。 我需要设置一些东西,以便在这个目录下不能执行脚本(php)。 将有多个用户上传图像到这个目录,但为了防万一他们的帐户被攻破,我想添加一些额外的保护,以便恶意的脚本不能执行。 该目录仅用于提供图像。 有什么build议么?

你想要的东西像:

<Directory /foo/bar> [other directives for this dir] AddHandler default-handler .php </Directory> 

固定。 我将以下新的目录容器添加到特定目录的Apache.conf文件中:

 <Directory /www/sites/www.example.com/html/images> RemoveHandler .php .phtml .php3 .php5 RemoveType .php .phtml .php3 .php5 php_flag engine off </Directory> 

来源: http : //www.phpfreaks.com/forums/index.php?topic=354749.0

<Directory>部分使用AddHandler强制PHP脚本通过default-handler