<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'install.windows.iis.php',
    1 => 'Windows の IIS と一緒にインストール',
    2 => 'Windows の IIS と一緒にインストール',
  ),
  'up' => 
  array (
    0 => 'install.windows.php',
    1 => 'Windows システムへのインストール',
  ),
  'prev' => 
  array (
    0 => 'install.windows.apache2.php',
    1 => 'Apache 2.x （Microsoft Windows 用）',
  ),
  'next' => 
  array (
    0 => 'install.windows.tools.php',
    1 => 'PHP をインストールするためのサードパーティーツール',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    '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">Windows の IIS と一緒にインストール</h2>

 <div class="simplesect">
  <h3 class="title">IIS のインストール</h3>
  <p class="simpara">
    Internet Information Services (IIS) は、
    Windows に標準で組み込まれています。
    Windows サーバーの場合は、
    サーバーマネージャーを使って IIS ロールを追加します。
    CGI ロールを含める必要があります。
    Windows デスクトップの場合は、
    コントロールパネルの「プログラムの追加と削除」を使って IIS を追加します。
    Microsoft のドキュメントに <a href="https://docs.microsoft.com/en-us/previous-versions/ms181052(v=vs.80)" class="link external">&raquo;&nbsp;詳細な手順があります</a>。
    デスクトップウェブアプリケーションやウェブ開発の場合は、IIS/Express や PHP Desktop も使えます。
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <span class="simpara">
    IIS と一緒に FastCGI ハンドラを使えば、
    Non-Thread Safe (NTS) 版の PHP のビルドがインストールされるはずです。
   </span>
  </p></blockquote>
 </div>
 <div class="simplesect">
  <h3 class="title">IIS と PHP を設定する</h3>

  <p class="simpara">
   IIS マネージャー内で、FastCGI モジュールをインストールし、
   <code class="literal">.php</code> のハンドラマッピングを
   <var class="filename">php-cgi.exe</var> に対して追加します。
   (<var class="filename">php.exe</var> ではありません)
  </p>

  <p class="simpara">
   IIS の設定をスクリプト化するには、
   <strong class="command">APPCMD</strong> コマンドラインツールが使えます。
  </p>
 </div>
 <div class="simplesect">
  <h3 class="title">サンプルのバッチスクリプト</h3>
  <div class="example" id="example-1">
   <p><strong>例1 IIS と 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); ?>