1. Unzip the downloaded PHP 5 zip package directly, and I will extract the PHP 5.2.4 zip file directly under the d:\php directory. Installing PHP does not recommend using the Win32 Installer (mainly for later installation extension trouble).
2. In the Explorer, enter the PHP installation directory, copy php.ini-dist or php.ini-recommended, and name it php.ini. Then open php.ini.
3. Find:
; Extension=php_mysql.dll
To be in front of; The number is removed and changed to:
Extension=php_mysql.dll
4. Find:
Extension_dir = "./"
Change it to the absolute path of your ext subdirectory in your PHP installation directory. For example, my:
Extension_dir = "d:/php/ext/"
This step is important. Otherwise, PHP will not find the Php_mysql.dll module and cannot be loaded.
5. In the "Control Panel", "System", "Advanced", "Environment variables", in the "system variables" found path, edit the value of the path variable, add your PHP directory D:\php, before you must use a semicolon (;) it and the preceding values are separated.
5. Configure Apache and PHP
Open the httpd.conf file in the Conf subdirectory of the Apache installation directory.
1. Find:
DocumentRoot "xxxxxxx"
A directory that changes to the content of your local site. For example, my:
DocumentRoot "E:/web"
After the change, pull down a little, find "# This should is changed to whatever you set DocumentRoot to." And change the place below.
2. Locate LoadModule, and add these two lines in the following blanks, based on your PHP installation directory:
LoadModule php5_module "D:/php/php5apache2_2.dll"
Phpinidir "d:/php"
3. Find:
DirectoryIndex index.html
Modified to:
DirectoryIndex index.php index.html
4. Find:
AddType application/x-gzip. gz. tgz
Add these two lines:
AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
5. Save httpd.conf