1、修改httpd.conf配置文件,加入如下内容
LoadModule php5_module
"D:/Develop/PHP/php5apache2_2.dll" //加载php模块
PHPIniDir
"D:/Develop/PHP" //指定php.ini所在的位置
AddType
application/x-httpd-php .php .html .htm //让apache解析php文件
----------------------------------------------------------------------------------------------------------
DirectoryIndex index.php index.html //修改默认首页文件
----------------------------------------------------------------------------------------------------------
DocumentRoot "D:/Develop/Apache2.2/htdocs"
<Directory "D:/Develop/Apache2.2/htdocs"> //这两处用来修改apache的默认根目录
----------------------------------------------------------------------------------------------------------
2、修改php.ini
----------------------------------------------------------------------------------------------------------
; On windows:
extension_dir =
"D:/Develop/PHP/ext" //用来指定php扩展所在的位置
指定好后可以根据需要开户可对应的扩展
3、环境
----------------------------------------------------------------------------------------------------------
- Apache httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
- PHP php-5.3.10-Win32-VC9-x86.zip
- MySQL mysql-5.5.20-win32.msi