How to add PHP support to IIS7 in Vista / Windows Server 2008.
Currently, many websites are written in PHP. However, the server environment is not necessarily FreeBSD or Linux. Many PHP websites run on Windows2000, Windows2003 and Windows Server 2008 systems. Moreover, according to many previous reports, the efficiency of running PHP in Windows Server 2008 has increased by more than 40%.
Next, let me enter today's topic, how to add support for PHP web pages under IIS7.
System environment: Vista / Windows Server 2008
1. First, install IIS7 (Control PanelPrograms and Features, Windows Features). Under the default selection conditions, remember to check the two options of ISAPI.
After the installation is complete, enter http://127.0.0.1 in the browser. If nothing goes wrong, an IIS7 welcome interface will appear.
2. Next, install PHP
and download the PHP installation package. You can go to: http://cn.php.net/downloads.php and download windows binaries here. After completing the PHP installation, I installed it in d:php. In this directory, find php.ini-dist, rename it to php.ini, and open php.ini:
Find: extension_dir = "./", replace with extension_dir = "d:php";
Found: Windows Extensions:
Remove the comments from each line under the module configuration below. The example is as follows:
extension=php_mbstring.dll
extension=php_gd2.dll
extension=php_MySQL.dll
save. Copy the file to your system's windows directory.
3. Create a new application pool in IIS7 and set the .Net type of the pool to unmanaged.
Create a new website and enable "Read" and "Run Script" permissions. After completion, add ISAPI Filters to this website.
Then add Handler Mapping
In the above process, add D:PHPphp5isapi.dll to Handler Mapping
OK, all operations are completed. Now you can test whether a PHP file works properly.