1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="install.windows.iis" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Installation with IIS for Windows</title>
<simplesect>
<title>Installing IIS</title>
<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's Add/Remove Programs.
The Microsoft documentation has <link xlink:href="https://docs.microsoft.com/en-us/previous-versions/ms181052(v=vs.80)">detailed instructions for enabling IIS</link>.
For development,
<link xlink:href="https://www.microsoft.com/en-us/download/details.aspx?id=48264">IIS/Express</link> can also be used.
</simpara>
<note>
<simpara>
The Non-Thread Safe (NTS) version of PHP should be installed when using
the FastCGI handler with IIS.
</simpara>
</note>
</simplesect>
<simplesect>
<title>Configuring PHP with IIS</title>
<simpara>
In IIS Manager, Install FastCGI module and add a handler mapping for
<literal>.php</literal> to the path to <filename>php-cgi.exe</filename>
(not <filename>php.exe</filename>)
</simpara>
<simpara>
The <command>APPCMD</command> command line tool can be used to script
IIS configuration.
</simpara>
</simplesect>
<simplesect>
<title>Example batch script</title>
<example>
<title>Command line to configure IIS and PHP</title>
<programlisting>
<![CDATA[
@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='PHP_via_FastCGI']
REM Set up the PHP handler
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='%phppath%\php-cgi.exe']
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='%phppath%\php-cgi.exe',resourceType='Unspecified']
%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='%phppath%\php-cgi.exe'].instanceMaxRequests:10000
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHP_FCGI_MAX_REQUESTS',value='10000']"
%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/fastCgi /+"[fullPath='%phppath%\php-cgi.exe'].environmentVariables.[name='PHPRC',value='%phppath%\php.ini']"
]]>
</programlisting>
</example>
</simplesect>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|