这是我的 httpd.conf 文件的输出,如果有人感兴趣的话:
ServerName desktop
# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module modules/libphp4.so
#AddHandler php-script .php
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script .php
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType text/html .php
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
AddType application/x-httpd-php .php
这是我的 php5.conf 文件:
<IfModule mod_php5.c>
<FilesMatch "\.ph(p3?|tml)$">
# SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
</FilesMatch>
# To re-enable php in user directories comment the following lines
# (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
# prevents .htaccess files from disabling it.
<IfModule mod_userdir.c>
<Directory /home/*/public_html>
# php_admin_value engine Off
</Directory>
</IfModule>
</IfModule>