PHP Sample Code for IIS 7

  1. Install IIS 7 by adding a role to the server.

  2. Add CGI/Fast CGI as an IIS feature (from cmd.exe):
    dism /online /enable-feature /featurename:IIS-CGI

  3. Download the latest PHP 5 from

  4. Install PHP as IIS FastCGI to “C:\PHP” (be sure to select script executable option to associate *.php with PHP).

  5. Edit C:\PHP\php.ini.
    short_open_tag = On
    cgi.force_redirect = 0

  6. Configure IIS on the system.

    1. Go to Start > Control Panel > Administrative Tools > Internet Information Services (IIS) Manager .

    2. Choose Sites > Default Web Site .

    3. Double-click on Handler Mappings in the right pane.

    4. Double-click on PHP_via_FastCGIModule .

    5. Click Request Restrictions.

    6. Select the Verbs tab.

    7. Select radial button One of the following verbs , enter “GET,POST,HEAD”.

    8. Select the Access tab.

    9. Select the Script radio button.

    10. Click OK all the way out and accept changes.

  7. Place scan.php, userInput.html and uploads folder into C:\Inetpub\wwwroot folder.

  8. Allow necessary security permission to both the files and the folder (for testing please allow to everyone).

  9. Configure Metadefender Core COM settings to allow IIS_USRS and IUSR to launch, access, and configure Metadefender Core (local permissions only).

  10. Restart Metadefender Core service.

  11. Go to http://localhost/userInput.html.

  12. Upload the file to be scanned. HTML calls PHP script and prints the scan results on the web page.