I.Download the installation package:
Apache2.2: http://mirrors.cnnic.cn/apache//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
PHP5.4: http://windows.php.net/downloads/releases/php-5.4.22-Win32-VC9-x86.zip
Mysql5.5: http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.35-winx64.msi
Of course, the software version is not limited to the above, but there are two points to note:
First, openssl in the Apache Software Package indicates that the openssl module is included. You can use openssl to configure an SSL link for Apache. If you use PHP in apache1 or apache2, you should select the VC6 version, if you use PHP in IIS, you should select the version of VC9;
Second, the difference between VC6 and VC9 in the PHP package: VC6 is compiled using visual studio 6, while VC9 is compiled using Visual Studio 2008, it also improves the performance and stability of using VC9 in Apache. To use PHP of VC9, you need to install Microsoft 2008 C ++ Runtime. Therefore, we recommend that you do not use VC9 in Apache.
In addition, it is our directory structure. To facilitate management, we install them in one piece. First, we create the WAMP folder, and then create the MySQL, PHP, and Apache folders respectively, later, we will install MySQL, PHP, and Apache in the corresponding folders. The directory structure is as follows:
II.Install software (many installation tutorials on the Internet are not mentioned here)
III.ApacheAnd PHP configuration
Find the php. ini-recommended file in the WAMPPHP folder, rename it to php. ini, and open it in the editor.
1. First find
; Directory in which the loadable extensions (modules) reside. extension_dir = "./"
To:
; Directory in which the loadable extensions (modules) reside.= "D:/Program Files/WAMP/PHP/ext"
(I installed it in the directory of Program Files on drive D, you can change it according to the actual situation) to specify the directory of the PHP extension package, so as to call the corresponding DLL file
2. Enable the extended library function
Find the following lines and remove the previous ";"
extension=php_curl.=php_gd2.=php_mbstring.=php_mysql.=php_mysqli.=php_pdo_mysql.=php_xmlrpc.dll
3. Configure the PHP Session Function
When using the session function, you must configure the session file storage directory on the server. Otherwise, you cannot use the session. You need to create a read/write directory folder. In this case, we will create the phpSessionTmp directory in the WAMP folder, then in php. in the INI file, find
;session.save_path = "/tmp"
To:
session.save_path = " D:/Program Files /WAMP/phpSessionTmp"
4. Configure the PHP file upload function
When using the PHP file upload function, you must specify a temporary folder to complete the file upload function. Create a phpFileUploadTmp folder in the WAMP folder, and find
;upload_tmp_dir =
To:
upload_tmp_dir = "D: /Program Files /WAMP/phpFileUploadTmp"
5. Modify date. timezone. The default value is the U.S. time. If it is not modified, an error is returned.
Find:
;.timezone =
To:
;.timezone = Asia/Shanghai
Well, the configuration of php. ini is complete, but this is not enough. We need Apache to support PHP, so we have to complete the corresponding PHP configuration in the Apache configuration file httpd. conf.
Find the httpd. conf file in the D: \ Program Files \ Wamp \ Apache \ conf folder and open
6. Under # LoadModule vhost_alias_module modules/mod_vhost_alias.so, add:
LoadModule php5_module "D:/Program Files/WAMP/PHP/php5apache2_2.dll""D:/Program Files/WAMP/PHP"/x-httpd-php .php .html .htm
7. By default, the Directory of the main web program executed by the Apache server is Apache2.2/htdocs. For convenience, we have created a www folder in the WAMP to replace htdocs, therefore, you need to modify the Apache configuration. The web program directory is changed to the www directory.
Find:
DocumentRoot "D:/Program Files/WAMP/Apache/htdocs"
To:
DocumentRoot " D:/Program Files/WAMP/wwwroot"
Find:
<Directory "D:/WAMP/Apache/htdocs">
Change
<Directory "D:/Program Files/WAMP/wwwroot">
8. Finally, modify the order of the index file. Because the PHP function is configured, index. php is required for priority execution.
Find:
DirectoryIndex index.html
To:
DirectoryIndex index.php .php index.html index.htm .html .htm
Now, the PHP environment configuration is basically complete. Let's give it a try.
Restart Apache, place a phpinfo. php file in WAMP/wwwroot, and write the code in phpinfo. php:
<??>
Then, enter http: // localhost/phpinfo. php in the address bar of the browser. Then, the page displays the basic configuration information of PHP, and our PHP environment is complete.