This article mainly introduces the graphic tutorial for setting up the php development environment in Windows 7, which is very detailed. If you need it, please refer to it. For Windows 7, you can download the Integrated Installation Package of WAMP (short for Windows, Apache, MySQL, and PHP) by setting up a PHP Development Environment on Windows.
There are many integrated development environments like PHP, such as XAMPP and AppServ ...... the PHP environment can be set up with one-click installation. However, this installation method is not flexible enough, and the free combination of software is not convenient, and it is not conducive to learning. Therefore, I still like to build a PHP Development Environment manually. You only need to install the module or upgrade the software without affecting other software, very convenient.
I. Preparations-download required software
Apache httpd-2.2.22-win32-x86-openssl-0.9.8t.msiPHP php-5.3.10-Win32-VC9-x86.zipMySQL mysql-5.5.20-win32.msi
Ii. Install software
Install Apache: Double-click to install Apache. It is no different from installing other Windows software. When you enter Server Infomation, there are no special rules as long as the entered information conforms to the format.
After the installation is complete, enter http: // localhost in the browser. If It Works is displayed !, Indicates that Apache is successfully installed.
Install PHP: extract php-5.3.10-win32-vc9-x86.zip to a directory.
Install MySQL: Double-click to install MySQL. To change the installation directory, select Custom in Choose Setup Type.
After the installation is complete, start configuring MySQL. Keep all the default options, but you 'd better change the default MySQL encoding to utf8. Set the password in the Modify Security Settings option and enter the password twice, click Execute to complete the configuration.
3. Integrate Apache + PHP + MySQL
Apache: first, modify the Apache configuration file so that Apache can parse the PHP file. The Apache configuration file is httpd. conf In the conf directory of the Apache installation directory.
1. Apache can parse the PHP file and find it in the configuration file.
The Code is as follows:
# LoadModule vhost_alias_module modules/mod_vhost_alias.so
Add in the next line (the Green position depends on the directory where PHP is located)
The Code is as follows:
LoadModule php5_module "D:/Develop/PHP/php5apache2_2.dll"
PHPIniDir "D:/Develop/PHP"
AddType application/x-httpd-php. php. html. htm
2. Find
The Code is as follows:
DirectoryIndex index.html
Change
The Code is as follows:
DirectoryIndex index. php index.html
3. Modify the directory of the Apache site and find it in the configuration file (the directory for Apache installation is different and the displayed value is different)
The Code is as follows:
DocumentRoot "D:/Develop/Apache2.2/htdocs"
Change
The Code is as follows:
DocumentRoot "D:/Workspace/PHP"
Find
The Code is as follows:
Change
The Code is as follows:
PHP: Rename php. ini-development to php. ini as the PHP configuration file. Modify php. ini
1. Set the directory of the PHP extension package and find
The Code is as follows:
; On windows:
; Extension_dir = "ext"
Change to (the value is the directory of the ext folder)
The Code is as follows:
; On windows:
Extension_dir = "D:/Develop/PHP/ext"
2. Enable the corresponding library function and find the row of the library to be enabled
The Code is as follows:
; Extension = php_curl.dll
; Extension = php_gd2.dll
; Extension = php_mbstring.dll
; Extension = php_mysql.dll
; Extension = php_xmlrpc.dll
Remove the semicolon (comment) and change it
The Code is as follows:
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 and find
; Date. timezone =
Change
Date. timezone = Asia/Shanghai
After the configuration is complete, check whether the configuration is successful. Restart Apache, create the file index. php In the site directory, and enter the following content:
The Code is as follows:
<? Php
Phpinfo ();
?>
Open the browser and enter http: // localhost. If the following content is displayed, the installation is successful and MySQL is associated successfully.