在php安装得时候:
./configure --prefix=/usr/local/php8011 --with-apxs2=/usr/local/httpd/bin/apxs
就会生成
/usr/local/httpd/modules/libphp.so
引入
需要修改Apache的配置文件httpd.conf以得到PHP的解析:
1、在LoadModule中添加:
LoadModule php5_module modules/libphp5.so
2、在AddType application/x-gzip .gz .tgz下面添加:
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
3、在DirectoryIndex增加 index.php,以便Apache识别PHP格式的index
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>