PHP Sample Code for IIS 7
-
Install IIS 7 by adding a role to the server.
-
Add CGI/Fast CGI as an IIS feature (from cmd.exe):
dism /online /enable-feature /featurename:IIS-CGI -
Download the latest PHP 5 from http://www.php.net/downloads.php.
-
Install PHP as IIS FastCGI to “C:\PHP” (be sure to select script executable option to associate *.php with PHP).
-
Edit C:\PHP\php.ini.
short_open_tag = On
cgi.force_redirect = 0 -
Configure IIS on the system.
-
Go to Start > Control Panel > Administrative Tools > Internet Information Services (IIS) Manager .
-
Choose Sites > Default Web Site .
-
Double-click on Handler Mappings in the right pane.
-
Double-click on PHP_via_FastCGIModule .
-
Click Request Restrictions.
-
Select the Verbs tab.
-
Select radial button One of the following verbs , enter “GET,POST,HEAD”.
-
Select the Access tab.
-
Select the Script radio button.
-
Click OK all the way out and accept changes.
-
-
Place scan.php, userInput.html and uploads folder into C:\Inetpub\wwwroot folder.
-
Allow necessary security permission to both the files and the folder (for testing please allow to everyone).
-
Configure Metadefender Core COM settings to allow IIS_USRS and IUSR to launch, access, and configure Metadefender Core (local permissions only).
-
Restart Metadefender Core service.
-
Upload the file to be scanned. HTML calls PHP script and prints the scan results on the web page.