本來看到這樣的問題時...想說應該很簡單呀...不是在 /etc/httpd/conf/httpd.conf
下...做個簡單的修改不是就好了嗎? 後來才發現原來 Apache 2.0 把這些外掛的Module 都移到 /etc/httpd/conf.d 裡面了...所以又花了一些時間上 Google 找資料...經過不斷的測試後...終於發現答案好簡單...可是過程可不簡單...可能是我太笨啦...^_^...
1. 編輯 /etc/httpd/conf.d/php.conf
2. 在檔案裡面加入紅色的這兩行
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
如下所示:
複製內容到剪貼板
代碼:
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 524288
</Files>
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
3. Apache 重啟
# service httpd restart
然後再檢查看看...您的Apache 是否認得 .php3 的副檔名啦...