4.1 修改apache配置文件支持php
修改DirectoryIndex index.html 为DirectoryIndex index.html index.php
并添加

在apache2中修改配置文件
#vi /usr/local/apache2/conf/httpd.conf
找到“#AddType application/x-gzip .gz .tgz”
并在后面加入
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

4.2 测试php支持
创建测试php页面test.php,并存放在网站主目录下,
<?php
phpinfo();
?>
重启apache服务后,访问http://ip/test.php