您查看的文章来源于http://www.oklinux.cn
(如果你不想安装ISPCONFIG,请跳过这节)
在ISPCONFIG 中你可以一个站点一个站点的配置PHP,这个行,那个不行。所以你应该先全局禁用PHP,以便能在ISPCONFIG中灵活配置
要全局禁用PHP,编辑/etc/mime.types 注释掉行:application/x-httpd-php
vi /etc/mime.types
[...] #application/x-httpd-php phtml pht php #application/x-httpd-php-source phps #application/x-httpd-php3 php3 #application/x-httpd-php3-preprocessed php3p #application/x-httpd-php4 php4 [...] |
编辑/etc/apache2/mods-enabled/php5.conf 这样做注释:
vi /etc/apache2/mods-enabled/php5.conf
<IfModule mod_php5.c> # AddType application/x-httpd-php .php .phtml .php3 # AddType application/x-httpd-php-source .phps </IfModule> |
重启Apache
/etc/init.d/apache2 restart