Originally from: http://www.cnblogs.com/pharen/archive/2012/02/06/2340628.html
On the basis of the original author, just made a detailed explanation. Avoid detours. (Note: The red font is my plus)
First, preparation-download the required software
- Apache Httpd-2.2.22-win32-x86-openssl-0.9.8t.msi
- PHP Php-5.3.10-win32-vc9-x86.zip
- MySQL Mysql-5.5.20-win32.msi
Second, install the software
install Apache: Double-click Installation, no different from installing other Windows software, when filling the server infomation, there is no special rules, as long as the information entered in accordance with the format.
After the installation is complete, in the browser input http://localhost, if the IT works! is displayed, the Apache installation is successful.
Apache2.2 installation directory: d:/develop/apache2.2
Install PHP: Unzip the php-5.3.10-win32-vc9-x86.zip to a directory.
PHP installation directory:d:/develop/php
Application Deployment directory: d:/workspace/php (default is:d:/develop/apache2.2/htdocs )
install MySQL: Double-click Install, if you need to change the installation directory, select Custom in the Choose Setup Type
After the installation is complete, configure MySQL to all the default options, but it is best to change the default MySQL encoding to UTF8, set the password in the Modify Security settings option, enter the password two times, and finish the configuration with the last execute.
Iii. Integration of Apache+php+mysql
Apache: First modify the Apache configuration file, let Apache support parsing php files. Apache configuration files are httpd.conf in the Conf directory of the Apache installation directory.
1. Allow Apache to parse the PHP file and locate it in the configuration file
#LoadModule Vhost_alias_module modules/mod_vhost_alias.so
Add on the next line (the green location is based on the directory where PHP is located)
LoadModule php5_module "d:/develop/php/php5apache2_2.dll"
Phpinidir "d:/develop/php"
AddType application/x-httpd-php. php. html. htm
2. Found in the configuration file
DirectoryIndex index.html
Switch
DirectoryIndex index.php index.html
3. Modify the Apache Site Directory, found in the configuration file (Apache installed directory, different values displayed)
DocumentRoot "d:/develop/apache2.2/htdocs"
Switch
DocumentRoot "d:/workspace/php"
Find it again.
<directory "d:/develop/apache2.2/htdocs" >
Switch
<directory "d:/workspace/php" >
PHP: Renamed Php.ini-development to php.ini as a PHP configuration file. Modify PHP.ini
1. Set the specific directory for the PHP expansion pack to find
; On Windows:
; Extension_dir = "ext"
Change to (value is the directory of Ext folder)
; On Windows:
Extension_dir = "d:/develop/php/ext"
2. Turn on the library function to locate the row of the library you want to open
; Extension=php_curl.dll
; Extension=php_gd2.dll
; Extension=php_mbstring.dll
; Extension=php_mysql.dll
; Extension=php_xmlrpc.dll
Remove the preceding semicolon (note) and change to
Extension=php_curl.dll
Extension=php_gd2.dll
Extension=php_mbstring.dll
Extension=php_mysql.dll
Extension=php_xmlrpc.dll
3. Set the time zone to find
;d Ate.timezone =
Switch
Date.timezone = Asia/shanghai
Configuration is complete to detect the success of the configuration. Restart Apache, in the Site directory, create a new file index.php, enter the content:
<?php
Phpinfo ();
?>
Open the browser input http://localhost, display the following content, the installation was successful, and successfully associated with MySQL.