Install and configure IIS + PHP5.2 in Windows. The installation of PHP in Windows is simple, but if you do not pay attention to the method, it will still give you a headache. In addition, the PHP5.2 version is different from the previous 4.x version, so it is necessary to record that it is easy to install PHP in Windows, but if you do not pay attention to the method, it will still cause you a headache. In addition, PHP 5.2 is different from the previous version 4.x, so it is necessary to record it to avoid forgetting this installation and configuration method next time.
Step 1: Download the installation package of php 5.2 for windows and decompress it to C: \ php. Note that the extracted directory can be on 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_c2.16.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 2: Set php under the c: \ php directory. ini-recommended (or php. ini-dist file, which is officially recommended) copy to the current directory and change the file name to php. ini;
Step 3: edit php. ini. Modify the values of the following two rows:
Extension_dir = "c: \ php \ ext"
Doc_root = "c: \ inetpub \ wwwroot"
You need to delete the comments at the beginning of the two rows. The value of extension_dir is the ext directory under the php installation directory, and the value of doc_root is the main directory set by IIS;
Step 4: set environment variables. Add the following values after Path:
;: \ Php
Then restart the computer.
Step 5: Open Internet information service, find "default website", and stop the website. Then open the "properties" page. On the "properties" page, find the "home directory" tab and click "configure" to add the application ING. The values are:
Executable file: c: \ php \ php5isapi. dll
Extension:. php
You do not need to modify other settings. after confirmation, restart the default website;
Step 6: create a new file hello. php under c: \ inetpub \ wwwroot. Input content:
World-Liehuo. Net
After saving, open the browser and enter the address http: // localhost/hello. php. If "Hello world" is displayed on the webpage, the installation is correct. You can also view the source code of hello. php on the webpage. if the source code does not contain the php code, the installation is correct.
Source: http://www.cnblogs.com/hsapphire/
Bytes. In addition, PHP 5.2 is different from the previous version 4.x, so it is necessary to record it to avoid...