1、编辑虚拟主机文件

vim /usr/local/apache2/conf/extra/httpd-vhosts.conf

2、添加以下模块

<Directory "/data/www/data">

php_admin_flag engine off

<filesmatch "(.*)php">

Order deny,allow

Deny from all

Allow from 127.0.0.1

</filesmatch>

</Directory>

3、打开浏览器访问显示禁止访问php