Back home for the holiday, I’ve had enough of Windows 8.1, reinstalled to Windows 7, and reconfigured my dev environment. There was no PHP environment before, but my blog is PHP, so I planned to install PHP too. After a day’s struggle, I finally finished installing the dev environment. Today I’ll first talk about using IIS 7.5 to parse PHP files.
First, you need IIS — too simple to elaborate. Mine is IIS 7.5. Then download PHP — search gives plenty, no need to repeat. Mine is PHP 5.3.10.
Find the php.ini-production file (that’s mine), rename it to php.ini, and open it for editing:
extension_dir = “D:PHP程序文件目录ext”
Remove the semicolon comments before extensions like:
extension=php_mysql.dll extension=php_mysqli.dll
Enable or disable specific modules as needed.
date.timezone = “Asia/Shanghai”
The above is a required item for PHP 5.3, otherwise a Warning appears when running phpinfo.
CGI configuration:
fastcgi.impersonate = 1 fastcgi.logging = 0 cgi.fix_pathinfo = 1 cgi.force_redirect = 0
IIS configuration: Select the website on the left, then double-click “Handler Mappings” on the right.
After entering the management page, select “Add Module Mapping” in the right menu. Then fill in the details as shown below; note the executable path should be chosen according to the php-cgi path on your machine.
Now create a file phpinfo.php in the IIS default root directory, enter <?php phpinfo(); ?> , save and access http://localhost/phpinfo.php with a browser. 
