一.下载地址:
apache2.2.21 官方下载地址:点击下载
php5.3.8官方下载地址:点击下载
mysql5.5官方下载地址:点击下载
二.安装:
安装mysql到 D:Program FilesMySQL目录下
安装apache到 D:MyWebApache2.2目录下
解压php的zip包到 D:MyWebphp目录下
三.配置:
所有程序安装好后,开始配置
1.配置apache支持php
设置php的配置文件php.ini,将php跟目录下(D:MyWebphp)的php.ini-development文件重命名为php.ini打开php.ini,找到如下配置,将extension_dir的值给为"D:/MyWeb/php/ext",并去掉前边的分号。如:; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "D:/MyWeb/php/ext"
doc_root是web应用的根目录,改为自己的web目录,如:D:/MyWeb/Apache2.2/htdocs,如:
; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
; http://php.net/doc-root
doc_root = "D:/MyWeb/Apache2.2/htdocs"
找到apache的位置文件(D:MyWebApache2.2conf.httpd.conf) 配置其支持php
LoadModule php5_module "D:/MyWeb/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
# 配置 php.ini 的路径
PHPIniDir "D:/MyWeb/php"
重启apache配置生效。
2.配置php支持mysql
只需要将php.ini文件中extension=php_mysql.dll前边的分号去掉即可,如下:
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
;extension=php_mysqli.dll
至此,配置完毕