[所需安装包]

httpd-2.2.22-win32-x86-openssl-0.9.8t.msi

MySQL_5.5.20_win32_XiaZaiBa.zip

vcredist2008sp1_x86_XiaZaiBa.zip

php-5.4.4-Win32-VC9-x86.zip

phpMyAdmin-3.3.10-english.zip

[安装apache]

#注1:建议所有的程序包尽量不要安装在C盘

#注1:安装apache需查看80端口是否被占用

windows2003下mysql+apache+php+phpmyadmin环境安装_mysql

点击运行httpd-2.2.22-win32-x86-openssl-0.9.8t.msi

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_02

Next后设置域名和服务名

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_03

注:此处输入的网络域名,如果是本机直接填localhost就可以了或者也可以根据本机情况去填写,下面2项分别是服务器名字和管理员EMAIL地址,按照实际情况填写就可以了。

接下来可以安装默认安装到结束

windows2003下mysql+apache+php+phpmyadmin环境安装_mysql_04

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_05

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_06

Apache安装结束,并桌面右下角会有运行的图标显示:

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_07

打开apache2.2/conf目录下的httpd.conf,找到DocumentRoot ""和<Directory "">修改为网站的根目录,默认的是apache2.2安装目录下的htdocs,此处不做目录修改

#测试

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_08

[安装php]

安装php前须安装VC环境,否则php和apache整合后apache无法开启

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_09

按默认安装完成

解压php-5.4.4-Win32-VC9-x86.zip,并将解压后的目录重命名为php

将php目录下的libeay32.dll及php5ts.dll拷贝到C:\WINDOWS下

然后将php目录下的php.ini-production拷贝到C:\WINDOWS下,并命名为php.ini

编辑C:\WINDOWS\php.ini

doc_root = "E:\apache.2.2\htdocs" #此路径根据apache中定义的路径定义

找到extension_dir = "ext" 修改为extension_dir = "E:\php\ext";注释,ext表示扩展模块的目录为E:\php\ext

取消以下模块前的注释

extension=php_bz2.dll

extension=php_curl.dll

extension=php_gd2.dll

extension=php_gettext.dll

extension=php_mbstring.dll

extension=php_mysql.dll

extension=php_mysqli.dll

extension=php_openssl.dll

extension=php_pdo_mysql.dll

extension=php_sockets.dll

extension=php_xmlrpc.dll

short_open_tag = On                 短标签<?  ?>开启 ,#建议开启

#以下选项可根据实际情况进行修改

post_max_size= 8M                 POST提交时候的最大数据提交量

magic_quotes_gpc = off              php自带的安全验证,建议开启

file_uploads = On                   php支持文件上传

upload_max_filesize = 2M            文件上传最大值 2M

max_file_uploads = 20               同时并发上传的最大文件数 

#设置时区

date.timezone = prc 

编辑apache2.2/conf/httpd.conf

找到DirectoryIndex,修改为DirectoryIndex index.html  index.php  #增加默认页面格式

找到# LoadModule foo_module modules/mod_foo.so这行,在其下增加

PHPIniDir "C:\Windows"#定义php配置位置

LoadModule php5_module  "E:\php\php5apache2_2.dll"

找到AddType application/x-gzip .gz .tgz行,并在其下增加

AddType application/x-httpd-php .php

#测试apache是否支持PHP

重启apache后,在E:\apache.2.2\htdocs下新建index.php页面

编辑index.php

<?

phpinfo();

?>

#完成后在浏览器测试

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_10

[安装mysql]

解压MySQL_5.5.20_win32_XiaZaiBa.zip

进入解压目录双击mysql-5.5.20-win32.msi进行安装

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_11

windows2003下mysql+apache+php+phpmyadmin环境安装_php_12

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_13

windows2003下mysql+apache+php+phpmyadmin环境安装_php_14

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_15

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_16

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_17

windows2003下mysql+apache+php+phpmyadmin环境安装_php_18

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_19

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_20

windows2003下mysql+apache+php+phpmyadmin环境安装_mysql_21

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_22

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_23

windows2003下mysql+apache+php+phpmyadmin环境安装_mysql_24

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_25

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_26

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_27

如在此处出现进程失去响应,原因为之前有装过mysql,并且卸载不干净导致,处理办法为:

1.删除安装目录及数据存放目录 C盘下的mysql目录、C:\Documents and Settings\All Users\Application Data下的mysql目录 及E盘下的mysql数据目录

2.在注册表(regedit)查询mysql,全部删除

.HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 目录

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 目录

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL 目录

3.建议最后操作以上步骤后,系统进行重启,然后重新进行安装

#测试

windows2003下mysql+apache+php+phpmyadmin环境安装_apache_28

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_29

windows2003下mysql+apache+php+phpmyadmin环境安装_php_30

[安装phpMyAdmin]

解压phpMyAdmin-3.3.10-english.zip,并重命名为phpMyAdmin

拷贝phpMyAdmin目录到apache网页存放目录,此处为E:\apache.2.2\htdocs

复制E:\apache.2.2\htdocs\phpMyAdmin\libraries\config.default.php

到E:\apache.2.2\htdocs\phpMyAdmin目录下,并重命名为config.inc.php

用notepad++编辑config.inc.php

找到$cfg['Servers'][$i]['auth_type'] = 'cookie';

修改为 $cfg['Servers'][$i]['auth_type']='http';

编辑E:\apache.2.2\conf\httpd.conf

在配置文件最低端追加以下内容

Alias /phpmyadmin "E:\phpMyAdmin"

<Directory  "E:\phpMyAdmin">

AllowOverride None

Options None

Order allow,deny

Allow from all

</Directory>

追加完成后,重启apache,进行测试

#测试

若出现以下错误

windows2003下mysql+apache+php+phpmyadmin环境安装_windows2003_31

编辑C:\WINDOWS\php.in

查看extension_dir = "ext" 是否修改为extension_dir = "E:\php\ext";

windows2003下mysql+apache+php+phpmyadmin环境安装_phpmyadmin_32