Host PHP on Windows with IIS

  • Enable CGI in iis
  • Go to control panel> turn on or off features> IIS>World wide services> application development features> CGI
  • Download non thread safe zip.
  • After downloading the zip rename it PHP.
  • Copy this file and paste it into C:\Program Files\
  • Goto control panel > system and security > system > advanced systems settings
  • In the advance tab locate the Environment variables
  • Select the path variable and click edit

  • Type new path name locating to the PHP files saved in program files. You can use browse button to locate it.
  • Open IIS, click Handler Mappings
  • Enter request path *.php, Module FastCgiModule and Exe path locate to C:\Program Files\PHP\php-cgi.exe
  • Right on sites in IIS and Add Website.
  • Enter the site name like phpdemo.
  • Go to the default document of the website and add index.php at top.
  • Right click the site and explore the folder.
  • Create a file index.php and add below code
<?php
    phpinfo();
 ?>
  • Save the file and open site in browser as shown below
  • The site should serve as

Leave a Comment