Step one: Download the PHP 5.2 for Windows installation package and extract it to C:\php. Note that this decompression directory can be under any disk, but the directory name cannot contain spaces;
The following is the php5.2 file directory:
c:\php
+--dev
| |-php5ts.lib
+--ext--Extension DLLs for PHP
| |-php_bz2.dll
| |-php_cpdf.dll
| |-..
+--extras
| +--mibs--Support files for SNMP
| +--openssl--Support files for OpenSSL
| +--pdf-related--Support files for PDF
| |-mime.magic
+--pear--Initial copy of Pear
|
|-go-pear.bat--Pear setup Script
|-fdftk.dll
|-..
|-php-cgi.exe--CGI executable
|-php-win.exe--executes scripts without an opened command prompt
|-php.exe-CLI executable-only for command line scripting
|-..
|-php.ini-dist--Default php.ini settings
|-php.ini-recommended--Recommended php.ini settings
|-php5activescript.dll
|-php5apache.dll
|-php5apache2.dll
|-..
|-php5ts.dll--Core PHP DLL
|-...
Step two: Copy the php.ini-recommended (or php.ini-dist file, officially recommended) under the C:\php directory to the current directory and modify the file name to PHP.ini;
Step three: Edit PHP.ini. Mainly modify the values of the following two lines:
Extension_dir = "C:\php\ext"
Doc_root = "C:\inetpub\wwwroot"
You need to delete these two lines at the beginning of a change; The Extension_dir value is the ext directory in the PHP installation directory, and the Doc_root value is the home directory of the IIS settings;
Step four: Set the environment variable. After path, add the following values:
;:\ Php
Then restart the computer.
Step Five: Open Internet Information Services, locate the default Web site, and stop the site. Then open the Properties page. In the Properties page, locate the Home Directory tab, and click the Configure button to add the application mappings. The values are:
Executable file: C:\php\php5isapi.dll
Name extension:. php
The rest does not need to be modified, after confirmation, restart the default Web site;
Step Six: Create a new file hello.php under C:\inetpub\wwwroot. Input content:
<title>World</title>
<body>
<?php echo "Hello World"?>
</body>
After saving, open the browser, enter the address: http://localhost/hello.php. If the page says Hello World, the installation is correct. We can also view the source code of the hello.php in the Web page, if the source code does not have PHP code, also shows that the installation is correct.