Step 1:Download installed files
1. MySQL: mysql-5.1.49-win32.msi;
2. Apache: httpd-2.2.16-win32-x86-openssl-0.9.8o.msi;
3. PHP5.3.3 php-5.3.3-Win32-VC6-x86 Note: Be sure to download the php-5.3.3-Win32-VC6-x86 version
, Do not download the php-5.3.3-nts-Win32-VC6-x86 version, do not download VC9 version, because he is the IIS Server Installation version.
Step 2:Installation File
1. Create a folder on the disk to be installed (the author created a php folder D: \ php under the root directory of drive D ).
2. Install the Apache server. The directory after installation is D: \ php \ Apache.
3. decompress the downloaded php-5.3.3-Win32-VC6-x86 in the d: \ php Directory, You can shorten the folder name, the result is D: \ php \ php5
4. Install the MySQL database. The installation is the same as normal. I installed it in the same directory as (D: \ PHP \ mysql) and PHP.
Step 3:Configure PHP5.3.3
1. configure php5.3.3 and open the PHP installation directory (The author is D: \ PHP \ PhP5). You can see two such files under the Directory: PHP. ini-Development and PHP. ini-production: the first is the development configuration file, and the second is the configuration of the standard production environment.
2. Select PHP. ini-development to copy a copy to the same directory and change it to PhP. ini. Use a text tool to open it and search for extension_dir.
Select the one on Windows: and change the semicolon to extension_dir = "D:/PHP/PhP5/EXT ".
According to your own directory structure configuration, the purpose is to find the extension library in the ext folder in the same directory as PHP. ini.
3. Find extension = PHP _ and remove extension = php_curl.dll, extension = php_gd2.dll, extension = php_mbstring.dll,
Extension = php_mysql.dll, extension = php_mysqli.dll, extension = php_pdo_mysql.dll, extension = php_xmlrpc.dll
. Search for short_open_tag = off and change it to short_open_tag = on to support short tags.
4. Copy the php5ts. dll file to the Windows/system32 directory, only the php-5.3.3-Win32-VC6-x86 version has php5ts. dll
The php-5.3.3-nts-Win32-VC6-x86 version is not available.
Step 4:Configure Apache
1. Open the httpd. conf file in the conf directory under the Apache directory and search for # loadmodule. At the end of the file, there are about 128 lines.
Add:
Loadmodule php5_module "D:/PHP/PhP5/php5apache2_2.dll"
Phpinidir "D:/PHP/PhP5"
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. htm
Addtype application/X-httpd-PHP. html
The directory structure is configured according to the user's own directory.
2. Search for directoryindex index.html and change it to directoryindex index. php default. php index.html index.htm default.html
Default.htm
3. Search for DocumentRoot and change it to the folder where you want to place the web files (I created
WWW folder) So DocumentRoot is DocumentRoot "D:/PHP/www". You can modify it according to your own configuration.
4. Search for the <directory "D:/PHP/www"> DocumentRoot path configured for you (the author is <directory "D:/PHP/www">)
5. Search
<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Deny from all
</Directory>
To:
<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Allow from all
</Directory>
If you do not change this page, you may encounter an error such as you don't have permission to access/on this server. Especially after you change the default homepage path.
Note: restart the Apache server every time you modify the httpd: CONF file. In addition, if the IIS server is also running on your Win32 system, you must stop the IIS server and then start Apache. Otherwise, the Apache server cannot be started.
Step 5: test whether the configuration of PHP + Apache + MySQL is successful
1. Open MySQL and create a new database and table in MySQL. (The userinfo database and users table have the ID and name fields)
Test? It's easy, huh, huh !!
2. Create an index. php file in the WWW folder created above and use editplus or another text tool to open it.
3. Write:
<?
$ Db_host = "localhost ";
$ Db_user = "root ";
$ Db_pass = "root ";
$ Db_name = "userinfo ";
Mysql_connect ($ db_host, $ db_user, $ db_pass );
Mysql_select_db ($ db_name );
Mysql_query ("set names gb2312 ");
$ SQL = "select * from users ";
$ Result = mysql_query ($ SQL );
While ($ DATA = mysql_fetch_array ($ result )){
Echo "------------------------";
Echo $ data ['id']. "<br/> ";
Echo $ data ['name']. "<br/> ";
}
Mysql_close ();
?>
4. Start the Apache server and enter http: // localhost/enter in the browser.
Reproduced to: http://www.blogjava.net/zyw090111/archive/2010/08/07/328197.html