1. Download the relevant installation package
Apache Download:
http://archive.apache.org/dist/httpd/binaries/win32/, choose Httpd-2.2.25-win32-x86-no_ssl.msi
PHP Download:
http://windows.php.net/downloads/releases/archives/, choose Php-5.3.5-win32-vc6-x86.zip
MySQL Download:
http://downloads.mysql.com/archives/community/, select 5.5.28 Windows (x86, 64-bit), MSI Installer download
2. Install MySQL
Note When installing the character set select UTF-8, root password is root
3. Installing Apache
Fill in the Domain name, service name, email
Choosing a Custom Installation
Select Installation Location
In the browser input localhost test installation is successful, if startup fails, check whether Port 80 is occupied.
4. Install the configuration PHP
4.1 Extract Php-5.3.5-win32-vc6-x86.zip to PHP535
4.2 Copy the Php.ini-development file and rename it to PHP.ini
4.3 Edit php.ini file, modify line No. 809, remove semicolon, modify to Extension_dir = "D:/lamp/php535/ext"
Line No. 959, open the mysql,mysqli extension
4.4 Configuring Http.conf
Open D:\LAMP\Apache2.2\conf\httpd.conf, and add the following line after the last LoadModule (around line 130th):
LoadModule php5_module "D:/lamp/php535/php5apache2_2.dll"
Phpinidir "d:/lamp/php535/"
AddType application/x-httpd-php. php. phtml
Around line No. 244 will
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Revision changed to
<ifmodule dir_module>
DirectoryIndex index.html index.php
</IfModule>
5. Testing
Create a test.php file in D:\LAMP\Apache2.2\htdocs with the following content:
<?php
Phpinfo ();
Accessing localhost/test.php in the browser will see that the MySQL extension has been added correctly
Create a sql.php file in D:\LAMP\Apache2.2\htdocs with the following content:
<?php
$conn =mysql_connect ("localhost", "root", "root");
Var_dump ($conn);
Accessing localhost/sql.php in the browser will print out the resource (3) of type (MySQL link). Indicates that the MySQL link was established successfully.
Configuring the APACHE+PHP+MYSQL environment under Windows