天天看點

apache支援php測試

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

本文轉自 轉身撞牆角 51CTO部落格,原文連結:http://blog.51cto.com/chentianwang/1738884