1.解压缩php压缩包,放入任意目录。
2.安装apache2.2和mysql
3.修改php.ini-development文件:
①重命名为php.ini。
②将;extension_dir的值改为php目录/ext(如d:/php/ext),去掉前面的;号;
③修改;session.save_path = "/tmp" ,改为任意存在目录(用来保存session),去掉前面的分号。
④修改
;extension=php_mbstring.dll
;extension=php_gd2.dll
;extension=php_mysql.dll
将前面的;去掉。
4.修改aphache配置文件:
①在第一行增加:
LoadModule php5_module "d:/php/php5apache2_2.dll
PHPINIDir "d:/php/php.ini" (这句实际上是为apache指定php位置文件,apache按以下顺序 寻找php.ini文件:
* PHPIniDir (Apache 2 module only)
* 注册表键值:HKEY_LOCAL_MACHINE—SOFTWARE—PHPIniFilePath
* 环境变量:%PHPRC%
* PHP5的目录 (for CLI), 或者web服务器目录(for SAPI modules)
* Windows目录(C:\windows or C:\winnt)
)
AddType application/x-httpd-php .php
AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html
②将DirectoryIndex的值加上"index.php"(这实际上时打开目录时的缺省文件,相当于javaweb中web.xml里的“welcome-file”).
③修改<documentroot> 改为任意存在的目录(这是根目录路径,默认为安装目录下的htdocs文件夹)