让Apache下某些目录不能执行PHP

在httpd.conf里加上下面的语句即可:
<Directory "/www/htdocs/xxx.com/html">
    php_flag engine off
</Directory>

如果是要让某个虚拟主机不支持PHP,则如下设置:
<VirtualHost *>
    ServerName www.xxx.com
    DocumentRoot /www/htdocs/xxx.com
    ServerAdmin webmaster@xxx.com
    ErrorLog /www/logs/apache/xxx.com/error_log
    CustomLog /www/logs/apache/xxx.com/access_log common
    php_flag engine off
</VirtualHost>

来源:http://linux.computersci.net/forum/showflat.php?Cat=&Board=UBB17&Number=1581&page=9&view=expanded&sb=1&o=&vc=1

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注