Basically I followed this step-by-step from Microsoft, but for my own sake I’m writing my own so it’s easier to find.
Setup IIS from Windows Control Panel
• Open Control Panel >> Programs >> Turn Windows features on or off
• Select Internet Information Services >> Expand and check CGI under World Wide Web Services — Application Development Features
• Test by opening http://localhost/ on your browser
![](https://surfandperf.com/wp-content/uploads/2023/09/image-4.png)
Download and Install PHP
• Create a C:\PHP folder on your local drive
• Download latest PHP non-thread-safe zip package from Windows PHP Download Page
![](https://surfandperf.com/wp-content/uploads/2023/09/image-5.png?w=1024)
• Download WinCache from SourceForge
![](https://surfandperf.com/wp-content/uploads/2023/09/image-6.png?w=1016)
• Extract PHP zip files to C:\PHP
• Extract WinCache zip files to C:\PHP\ext
• Open Control Panel >> System and Security >> System >> Advanced System Settings
• On System Properties >> Go to Advanced tab and add a C:\PHP System Variable under Environment Variables
![](https://surfandperf.com/wp-content/uploads/2023/09/image-7.png?w=1024)
• Open IIS Manager >> Select your machine under connections >> Open Handler Mappings
![](https://surfandperf.com/wp-content/uploads/2023/09/image-8.png?w=1024)
• Add Module Mapping with the following details:
- Request path: *.php
- Module: FastCgiModule
- Executable: C:\PHP\php-cgi.exe (location of php-cgi.exe within your PHP folder)
![](https://surfandperf.com/wp-content/uploads/2023/09/image-9.png?w=1024)
• Add Default Document by going to Default Document >> Add >> add default.php and index.php
![](https://surfandperf.com/wp-content/uploads/2023/09/image-10.png?w=1024)
• Create a PHP Info page to test
- Create a phpinfo.php file on Notepad++ (run as Admin) with the following code:
<?php phpinfo(); ?>
… and save inside C:\inetpub\wwwroot\
![](https://surfandperf.com/wp-content/uploads/2023/09/image-11.png?w=728)
• Open http://localhost/phpinfo.php on your browser and you should see this page
![](https://surfandperf.com/wp-content/uploads/2023/10/image-2-1024x664.png)
End. 🙂
Hope this helps.