Windows Apache PHP5安装详细教程
下载的apache要记得下OPENSSL的
httpd-2.2.19-win32-x86-openssl-0.9.8r.msi
下载的PHP记得下线程安全的,这样才便于搭建http服务
php教程-5.2.17-Win32-VC6-x86.msi
下面就是转载的了
此文章的安装方法适用于Windows XP下的Apache+PHP+MySQL安装,同时也适用于Windows 2003系统下的安装和配置。
1. 安装环境
操作系统是 Windows XP 中文版, Apache, PHP, MySQL 的最新版本是截止到 2007.09.07,分别在其官网下载的:
* Apache 2.2.6:http://apache.mirror.phpchina.com/httpd/binaries/win32/
* PHP 5.2.4 (Windows Binaries PHP 5.2.4 zip package): http://www.php.net/downloads.php
* MySQL 5.0.45 Windonws: http://dev.mysql教程.com/downloads/
2. 安装的目录结构规划
为了方便维护,可以将服务器软件安装在系统盘(C盘)而把自己的文件定位到其他盘,这样对于以后的维护很重要。
3. 在 Windows XP 下安装 Apache 2.2.6
Windows XP 下的安装
1. 运行 apache 2.2.6 的安装程序,根据提示一路 Next 即可。在 Server Information 的 Network Domain、Server Name 字段随便填上一个域名即可,如php.com,然后根据提示一路 Next 完成即可。
2. 在安装结束时,会弹出一个 DOS 窗口,然后就消失了,这是系统apache自动启动了。
4. 在 Windows XP 下安装 php 5.2.4
1. 将下载的 php 5 ZIP 包直接解压,我直接将 PHP 5.2.4 zip 文件解压到 d:php 目录下面。安装 php 不建议使用 win32 安装程序(主要是以后安装扩展麻烦)。
2. 在资源管理器中进入 php 的安装目录,将 php.ini-dist 或 php.ini-recommended 复制一份,命名为 php.ini。然后打开 php.ini。
3. 找到:
;extension=php_mysql.dll
将前面的 ; 号去掉, 改成:
extension=php_mysql.dll
4. 找到:
extension_dir = “./”
将其改为你的 php 安装目录下 ext 子目录的绝对路径。例如我的:
extension_dir = “D:/php/ext/”
这步很重要 。否则接下来 php 会找不到 php_mysql.dll 模块,无法装载。
5. 在“控制面板”->“系统”->“高级”->“环境变量”,在“系统变量”里面找到path,编辑path的变量值,添加你的php目录D:php,前面一定要用分号(;)把它和前面的值分开。
5. 配置 Apache 和 PHP
打开 Apache 安装目录下的 conf 子目录中的 httpd.conf 文件。
1. 找到:
DocumentRoot “xxxxxxx”
改成你本机的网站内容的目录。例如我的:
DocumentRoot “E:/web”
改完之后往下稍微拉动一下,找到“# This should be changed to whatever you set DocumentRoot to.”,然后把下面这个地方也改过来
PHPIniDir “D:/PHP”这个不要了,免得apache服务器启动不起
3. 找到:
DirectoryIndex index.html
修改为:
DirectoryIndex index.php index.html
4. 找到:
AddType application/x-gzip .gz .tgz
添加这两行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
5. 保存 httpd.conf
6. 在你的网站目录中(例如我的是 E:/Web/),手工建立一个 index.php 的文件,内容:
phpinfo();
?>
7. 在 dos 窗口中启动 apache 服务(假设Apache安装在了C:Program FilesApache Software FoundationApache2.2)
#如果之前启动了,先将其 stop
C:Program FilesApache Software FoundationApache2.2bin> httpd -k stop
或者是:net stop apache2.2
#启动 apahce 服务
C:Program FilesApache Software FoundationApache2.2bin> httpd -k start
或者是:net start apache2.2
8. 打开 http://localhost/index.php,即可看到测试输出结果。
6. Windows XP 下安装 MySQL 5.0.45
MySQL 的安装比较简单,它提供了一个 win32 的安装包。下载后根据提示一路安装,也可以在安装类型处选 Custom,指定安装目录,这里直接默认安装在了C盘。
安装完成后,会问你要不要到官网注册,跳过即可。然后会问你是否 Configure the MySQL Server now,选中并继续,然后根据提示,设定 字符集,以及 root 管理员的密码即可。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
