Configure Apache2 + PHP5 + MySQL5 Apache in Windows
1. download related software:
Apache HTTP Server (httpd) 2.X: (Win32 Binary)
PHP 5.X VC6 x86 Thread Safe: (VC6 compressed version is selected, and VC9 version is used for integration with IIS)
MySQL Community Server 5.X: (select the installation version)
2: install software:
Apache: installed by default. click next until the installation is complete.
Php: unzip the package.
MySQL: installed by default. select database encoding.
3: Port problems:
The service is automatically started after Apache HTTP Server is installed. the default port is80If the IIS service has been started, httpd cannot be started.
4: solution:
Stop IIS service: Control Panel> Administrative Tools> Internet Information Service (IIS) Manager> Website> default website> Stop (right side)
Change IIS Port: Website> default website> Edit binding (right-click)> Edit> Change Port> restart
Change httpd Port: installation directory-> conf-> httpd. conf-> SearchListen 80-> Change the port (for example8888)-> Restart the service
5. configure Apache + PHP:
Browse: http: // localhost: 8888/. if:It works!The Apache HTTP Server is successfully installed.
Set environment variables: System Properties> Advanced System Settings> environment variables> System variables>PathAppend after:
% JAVA_HOME %/bin; D:/php/ext/
Set the PHP Directory: open conf-> http. conf and add the following content at the end of the configuration file:
PHPIniDir "D:/php /"
LoadModule php5_module "D:/php/php5apache2_2.dll"
Added PHPMIME support: SearchAddType or -> Append:
AddType application/x-httpd-php. php
Configure PHP: rename php. ini-developmentPhp. ini
Note:You must restart the Apache service to modify the configuration.
7. test whether the configuration is successful:
Go to the htdocs directory and create test. php. the code is as follows:
Phpinfo ();
?>
<浏览:http: localhost:8888 test.php ,成功页面见附图:< p>
8: Configure MySQL:
Add MySQL extension: php. ini->;Extension = php_mysql.dll-> remove the semicolon and enable php_mysql.dll.
Specify the MySQL database location: php. ini-> to extension_dir = "D:/php/ext", that is, the directory of php_mysql.dll.
9: test whether the configuration is successful:
Go to the htdocs directory and create db. php. the code is as follows:
Browse: http: // localhost: 8888/db. php. The Success page is shown in the figure below:
10: set the default page:
SearchDirectoryIndex
Append index. php:
DirectoryIndex index.html Index. php
10: add a virtual directory:
Find:
Options FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all
Append:
Alias/dwz "D:/dwz /"
Options Indexes FollowSymLinks
AllowOverride None
Order allow, deny
Allow from all
Browsing method: http: // localhost: 8888/dwz/
Successful PHP configuration page
MySQL success page with four default databases
Author: zhanqi
Source: http://www.cnblogs.com/zhanqi/
The copyright of this article is shared by the author and the blog. For more information, see the author and its source.