一,apache禁止指定目录执行php文件
复制代码代码示例:
<Directory /home/centos/web/data>
php_flag engine off </Directory> <Directory ~ "^/home/centos/web/data"> <Files ~ ".php"> Order allow,deny Deny from all </Files> </Directory>
二,nginx禁止指定目录执行php文件
复制代码代码示例:
location /data/ {
(责任编辑:IT)location ~ .*\.(php)?$ { deny all; } } 或 location ~* ^/(attachments|upload)/.*\.(php|php5)$ { deny all; } |