<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/install.windows.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'install.windows.iis.php',
    1 => 'Installation with IIS for Windows',
    2 => 'Installation with IIS for Windows',
  ),
  'up' => 
  array (
    0 => 'install.windows.php',
    1 => 'Installation on Windows systems',
  ),
  'prev' => 
  array (
    0 => 'install.windows.apache2.php',
    1 => 'Installation for Apache 2.x on Windows systems',
  ),
  'next' => 
  array (
    0 => 'install.windows.tools.php',
    1 => 'Strumenti di terze parti per installare PHP',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'install/windows/iis.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="install.windows.iis" class="sect1">
 <h2 class="title">Installation with IIS for Windows</h2>

 <div class="simplesect">
  <h3 class="title">Installing IIS</h3>
  <p class="simpara">
   Internet Information Services (IIS) is built in to Windows.
   On Windows Server, the IIS role can be added via the Server Manager.
   The CGI Role Feature needs to be included.
   On Windows Desktop, IIS has to be added via the Control Panel&#039;s Add/Remove Programs.
   The Microsoft documentation has <a href="https://docs.microsoft.com/en-us/previous-versions/ms181052(v=vs.80)" class="link external">&raquo;&nbsp;detailed instructions for enabling IIS</a>.
   For development,
   <a href="https://www.microsoft.com/en-us/download/details.aspx?id=48264" class="link external">&raquo;&nbsp;IIS/Express</a> can also be used.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    The Non-Thread Safe (NTS) version of PHP should be installed when using
    the FastCGI handler with IIS.
   </span>
  </p></blockquote>
 </div>
 <div class="simplesect">
  <h3 class="title">Configuring PHP with IIS</h3>

  <p class="simpara">
   In IIS Manager, Install FastCGI module and add a handler mapping for
   <code class="literal">.php</code> to the path to <var class="filename">php-cgi.exe</var>
   (not <var class="filename">php.exe</var>)
  </p>

  <p class="simpara">
   The <strong class="command">APPCMD</strong> command line tool can be used to script
   IIS configuration.
  </p>
 </div>
 <div class="simplesect">
  <h3 class="title">Example batch script</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 Command line to configure IIS and PHP</strong></p>
   <div class="example-contents">
<div class="cdata"><pre>

@echo off

REM download .ZIP file of PHP build from http://windows.php.net/downloads/

REM path to directory into which PHP .ZIP file was decompressed (no trailing \)
set phppath=c:\php


REM Clear current PHP handlers
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM The following command will generate an error message if PHP is not installed. This can be ignored.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /-[name=&#039;PHP_via_FastCGI&#039;]

REM Set up the PHP handler
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath=&#039;%phppath%\php-cgi.exe&#039;]
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name=&#039;PHP_via_FastCGI&#039;,path=&#039;*.php&#039;,verb=&#039;*&#039;,modules=&#039;FastCgiModule&#039;,scriptProcessor=&#039;%phppath%\php-cgi.exe&#039;,resourceType=&#039;Unspecified&#039;]
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /accessPolicy:Read,Script

REM Configure FastCGI Variables
%windir%\system32\inetsrv\appcmd set config -section:system.webServer/fastCgi /[fullPath=&#039;%phppath%\php-cgi.exe&#039;].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+&quot;[fullPath=&#039;%phppath%\php-cgi.exe&#039;].environmentVariables.[name=&#039;PHP_FCGI_MAX_REQUESTS&#039;,value=&#039;10000&#039;]&quot;
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+&quot;[fullPath=&#039;%phppath%\php-cgi.exe&#039;].environmentVariables.[name=&#039;PHPRC&#039;,value=&#039;%phppath%\php.ini&#039;]&quot;
</pre></div>
   </div>

  </div>
 </div>
</div><?php manual_footer($setup); ?>