<?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 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'install.windows.iis.php',
    1 => 'Instala&ccedil;&atilde;o com IIS no Windows',
    2 => 'Instala&ccedil;&atilde;o com IIS no Windows',
  ),
  'up' => 
  array (
    0 => 'install.windows.php',
    1 => 'Instala&ccedil;&atilde;o em sistemas Windows',
  ),
  'prev' => 
  array (
    0 => 'install.windows.apache2.php',
    1 => 'Instala&ccedil;&atilde;o para Apache 2.x em sistemas Windows',
  ),
  'next' => 
  array (
    0 => 'install.windows.tools.php',
    1 => 'Ferramentas de terceiros para instalar o PHP',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    '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">Instalação com IIS no Windows</h2>

 <div class="simplesect">
  <h3 class="title">Instalando o IIS</h3>
  <p class="simpara">
   Internet Information Services (IIS) é incluído no Windows.
   No Windows Server, a função IIS pode ser adicionada através do Gerenciador do Servidor.
   O recurso CGI Role precisa ser incluído.
   No Windows Desktop, o IIS deve ser adicionado através da opção Adicionar/Remover Programas do Painel de Controle.
   A documentação da Microsoft tem <a href="https://docs.microsoft.com/en-us/previous-versions/ms181052(v=vs.80)" class="link external">&raquo;&nbsp;instruções detalhadas para habilitar o IIS</a>.
   Para desenvolvimento, o
   <a href="https://www.microsoft.com/en-us/download/details.aspx?id=48264" class="link external">&raquo;&nbsp;IIS/Express</a> também pode ser usado.
  </p>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <span class="simpara">
    A versão Não Segura para Threads (NTS) do PHP deve ser instalada ao usar
    o manipulador FastCGI com o IIS.
   </span>
  </p></blockquote>
 </div>
 <div class="simplesect">
  <h3 class="title">Configurando o PHP com o IIS</h3>

  <p class="simpara">
   No Gerenciador IIS, instale o módulo FastCGI e adicione um manipulador para mapear a
   extensão <code class="literal">.php</code> para o caminho do <var class="filename">php-cgi.exe</var>
   (não para o <var class="filename">php.exe</var>).
  </p>

  <p class="simpara">
   A ferramenta de linha de comando <strong class="command">APPCMD</strong> pode ser usada para
   executar a configuração do IIS através de script.
  </p>
 </div>
 <div class="simplesect">
  <h3 class="title">Exemplo de script em lote</h3>
  <div class="example" id="example-1">
   <p><strong>Exemplo #1 Linha de comando para configurar o IIS e o PHP</strong></p>
   <div class="example-contents">
<div class="cdata"><pre>

@echo off

REM obtenha o arquivo .ZIP da compilação PHP em http://windows.php.net/downloads/

REM caminho para o diretório onde o arquivo .ZIP do PHP foi descompactado (sem \ no final)
set phppath=c:\php


REM Limpa os manipuladores de PHP atuais
%windir%\system32\inetsrv\appcmd clear config /section:system.webServer/fastCGI
REM O comando a seguir irá gerar uma mensagem de erro se o PHP não estiver instalado. Isto pode ser ignorado.
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /-[name=&#039;PHP_via_FastCGI&#039;]

REM Configura o manipulador do PHP
%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 Configura as variáveis FastCGI
%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); ?>