heshao2005 发表于 2015-8-4 08:52:46

在 Windows 下安装 WAMP(Apache、MySQL、PHP)详细图文教程

  LAMP(Linux + Apache + MySQL + PHP)架构是目前世界上最流行的中小型网站服务的采用的环境,其易用性、安全性得到了广大用户的认可。在广大 Windows 操作系统的使用者中,不乏想要要采用“AMP”服务器环境的 Web 开发者,本文将详细介绍如何在 Windows 系统下安装 Apache、MySQL、PHP 服务器环境。
  
  笔者采用的是 Windows 7 Ultimate 操作系统,并在 Windows XP Professional 和 Windows 2003 Server 系统上测试通过,理论上支持包括 2000、XP、2003、Vista、7、2008 在内的所有 NT 4.0 以上的 Windows 操作系统。
安装前的准备工作
  首先,到各软件官方网站下载其最新版安装程序:

[*]Apache HTTP Server 2.2.17
下载页面:http://httpd.apache.org/download.cgi
http://www.apache.org/dist/httpd/binaries/win32/
[*]PHP 5.3.5 (VC6 x86 Thread Safe)
下载页面:http://php.net/downloads.php
http://windows.php.net/download/
[*]MySQL Community Server 5.5.8
下载页面:http://www.mysql.com/downloads/mysql/
  Apache HTTP Server 我们下载 No SSL 版本的(OpenSSL 即网页加密传输,我们不需要)最新版 MSI 安装包。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-install-01.png
  PHP 我们点击进入 Windows 版本下载页面。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-install-03.png
  由于我们使用的是 Apache 2 环境(而非 IIS),我们选择 VC6 的最新版的 MSI 安装包。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-install-04.png
  MySQL Community Server 我们根据电脑的 CPU 处理器参数选择 32-bit 或 64-bit 的最新版 MSI 安装包下载。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-install-02.png
  三个软件安装包下载完成。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-install-05.png
第一步,执行 Apache HTTP Server 的安装。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-apache-01.jpg
  Network Domain 和 Server Name 均填“localhost”,Administrator’s Email Address 填写管理员的电邮地址。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-apache-04.jpg
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-apache-05.jpg
  Destination Folder,填入自定的 Apache HTTP Server 的安装路径。图为笔者的安装路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-apache-06.jpg
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-apache-09.jpg
第二步,执行 PHP 的安装。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-php-01.jpg
  Destination Folder,填入自定的 PHP 的安装路径。图为笔者的安装路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-php-03.jpg
  Web Server Setup,这里我们选择“Apache 2.2.x Module”,以挂载于 Apache HTTP Server 上使用。(将会在 PHP 安装目录下安装 php5apache2_2.dll 文件)
  在“Apache Configuration Directory”中选择正确的 Apache 的配置文件路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-php-04-01.jpg
  此处“Extensions”选择安装全部组件。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-php-05.jpg
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-php-08.jpg
第三步,执行 MySQL Community Server 的安装。
  点选 Custom 安装类型。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-03.jpg
  Location 填入自定的 MySQL Community Server 安装路径。图为笔者的安装路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-04.jpg
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-05.jpg
  MySQL 企业版特性介绍,略过。点击完成后进入 MySQL 配置向导。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-10.jpg
  选择“Detailed Configuration”,即详细配置。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-11.jpg
  选择“Developer Machine”,即用于开发的机器。“Server Machine”为用于服务器的配置,“Dedicated MySQL Server Machine”为全部计算机资源用户运行 MySQL 服务。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-12.jpg
  选择“Multifunctional Database”。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-13.jpg
  InnoDB Tablespace Settings,选择自定的 MySQL 数据库数据文件存储位置。图为笔者选择的路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-14.jpg
  选择“Decision Support (DSS)/OLAP”,设置 MySQL 服务器的最大用户连接数量。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-15.jpg
  通过 TCP/IP 网络使用 MySQL 服务,按默认配置。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-16.jpg
  设置 MySQL 数据库字符集,选择“Manual Selected Default Character Set / Collation”,并调整“Character Set”为“utf8”。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-17.jpg
  设置 Windows 下的 MySQL 服务,取消勾选“Launch the MySQL Server automatically”意为不开机自动启动 MySQL 服务。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-18.jpg
  MySQL 服务安全选项。在“root password”中填入自定的管理员密码。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-19.jpg
  准备应用设置,点击“Execute”完成。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-mysql-23.jpg
  至此,MySQL Community Server 安装完毕。
第四步,配置 WAMP 集成环境。
  找到 Apache HTTP Server 的配置文件“httpd.conf”所在地(安装目录下的 conf 文件夹内),用文本编辑器(如记事本等,笔者使用的是 EmEditor)打开。
  找到“DocumentRoot”开头的一行,引号内即为 Web 根目录的路径,我们修改为自定的目录路径。
http://www.ychong.com/wp-content/uploads/2011/06/20110612-wamp-installation-config-05.png
  同时找到“
页: [1]
查看完整版本: 在 Windows 下安装 WAMP(Apache、MySQL、PHP)详细图文教程