Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 8236

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Microsoft IIS 5.1 and IIS 6.0</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.windows.iis.html">Microsoft IIS</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.windows.iis7.html">Microsoft IIS 7.0 and later</a></div>
 <div class="up"><a href="install.windows.html">Installation on Windows systems</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="install.windows.iis6" class="sect1">
 <h2 class="title">Microsoft IIS 5.1 and IIS 6.0</h2>
 <p class="para">
  This section contains instructions for manually setting up Internet Information 
  Services (IIS) 5.1 and IIS 6.0 to work with PHP on Microsoft Windows XP and Windows 
  Server 2003. For instructions on setting up IIS 7.0 and later versions on Windows 
  Vista, Windows Server 2008, Windows 7 and Windows Server 2008 R2 refer to 
  <a href="install.windows.iis7.html" class="link">Microsoft IIS 7.0 and later</a>.
 </p>
 <div class="sect2" id="install.windows.iis6.fastcgi">
  <h3 class="title">Configuring IIS to process PHP requests</h3>
  <p class="para">
   Download and install PHP in accordance to the instructions described in 
    <a href="install.windows.manual.html" class="link">manual installation steps</a>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      Non-thread-safe build of PHP is recommended when using IIS. The non-thread-safe 
      builds are available at <a href="http://windows.php.net/download/" class="link external">&raquo;&nbsp;PHP for Windows: 
      Binaries and Sources Releases.</a>
     </p>
    </p></blockquote>
  </p>
  <p class="para">
   Configure the CGI- and FastCGI-specific settings in <var class="filename">php.ini</var> file as shown below:
   <div class="example" id="example-36">
    <p><strong>Example #1 CGI and FastCGI settings in <var class="filename">php.ini</var></strong></p>
    <div class="example-contents">
<div class="inicode"><pre class="inicode">fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.fix_pathinfo=1
cgi.force_redirect = 0</pre>
</div>
    </div>

   </div>
  </p>
  <p class="para">
   Download and install the <a href="http://www.iis.net/extensions/fastcgi" class="link external">&raquo;&nbsp;Microsoft FastCGI Extension for IIS 5.1 and 6.0</a>. 
   The extension is available for 32-bit and 64-bit platforms - select the right download package for your platform.
  </p>
  <p class="para">Configure the FastCGI extension to handle PHP-specific requests by running the command shown below. 
   Replace the value of the &quot;-path&quot; parameter with the absolute file path to the 
   <var class="filename">php-cgi.exe</var> file.
   <div class="example" id="example-37">
    <p><strong>Example #2 Configuring FastCGI extension to handle PHP requests</strong></p>
    <div class="example-contents">
<div class="cdata"><pre>
cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:&quot;PHP&quot; ^
-extension:php -path:&quot;C:\PHP\php-cgi.exe&quot;
</pre></div>
    </div>

   </div>
  </p>
  <p class="para">
   This command will create an IIS script mapping for *.php file extension, which will result in all URLs 
   that end with .php being handled by FastCGI extension. Also, it will configure FastCGI extension to 
   use the executable <var class="filename">php-cgi.exe</var> to process the PHP requests.
   <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      At this point the required installation and configuration steps are completed. The remaining 
      instructions below are optional but highly recommended for achieving optimal functionality 
      and performance of PHP on IIS.
     </p>
   </p></blockquote>
  </p>
 </div>
 <div class="sect2" id="install.windows.iis6.impersonation">
  <h3 class="title">Impersonation and file system access</h3>
  <p class="para">
   It is recommended to enable FastCGI impersonation in PHP when using IIS. This 
   is controlled by the <var class="varname"><var class="varname">fastcgi.impersonate</var></var> directive in <var class="filename">php.ini</var> file. When 
   impersonation is enabled, PHP will perform all the file system operations on 
   behalf of the user account that has been determined by IIS authentication. This 
   ensures that even if the same PHP process is shared across different IIS web 
   sites, the PHP scripts in those web sites will not be able to access each 
   others&#039; files as long as different user accounts are used for IIS authentication 
   on each web site.
  </p>
  <p class="para">
   For example IIS 5.1 and IIS 6.0, in its default configuration, has anonymous authentication enabled 
   with built-in user account IUSR_&lt;MACHINE_NAME&gt; used as a default identity. This means that in 
   order for IIS to execute PHP scripts, it is necessary to grant IUSR_&lt;MACHINE_NAME&gt; account 
   read permission on those scripts. If PHP applications need to perform write operations on certain 
   files or write files into some folders then IUSR_&lt;MACHINE_NAME&gt; account should have write permission to those.
  </p>
  <p class="para">
   To determine which user account is used by IIS anonymous authentication, follow these steps:
   <div class="procedure">
    <ol type="1"><li>
     <p class="simpara">In the Windows Start Menu choose &quot;Run:&quot;, type &quot;inetmgr&quot; and click &quot;Ok&quot;;</p>
    </li>
    <li>
     <p class="simpara">Expand the list of web sites under the &quot;Web Sites&quot; node in the tree view, right-click on a web 
      site that is being used and select &quot;Properties&quot;;
     </p>    
    </li>
    <li>
     <p class="simpara">Click the &quot;Directory Security&quot; tab;</p>    
    </li>
    <li>
     <p class="simpara">Take note of a &quot;User name:&quot; field in the &quot;Authentication Methods&quot; dialog</p>
    </li>
   </ol></div>
   <div class="mediaobject">
    
    <div class="imageobject">
     <img src="images/b4cf2bb34e3c20eebcf8f9e8e7949efd-iis6anonauth.png" alt="Anonymous authenication for IIS 5.1 and IIS 6.0" width="654" height="461" />
    </div>
   </div>
  </p>
  <p class="para">
   To modify the permissions settings on files and folders, use the Windows Explorer user interface 
   or <var class="varname"><var class="varname">icacls</var></var> command.
   <div class="example" id="example-38">
    <p><strong>Example #3 Configuring file access permissions</strong></p>
    <div class="example-contents">
<div class="cdata"><pre>
icacls C:\inetpub\wwwroot\upload /grant IUSR:(OI)(CI)(M)
</pre></div>     
    </div>

   </div>
  </p>
 </div>
 <div class="sect2" id="install.windows.iis6.defaultdoc">
  <h3 class="title">Set <var class="filename">index.php</var> as a default document in IIS</h3>
  <p class="para">
   The IIS default documents are used for HTTP requests that do not specify a document name. With PHP applications, 
   <var class="filename">index.php</var> usually acts as a default document. To add <var class="filename">index.php</var> to the list of 
   IIS default documents, follow these steps:
   <div class="procedure">
    <ol type="1"><li>
     <p class="simpara">In the Windows Start Menu choose &quot;Run:&quot;, type &quot;inetmgr&quot; and click &quot;Ok&quot;;</p>
    </li>
    <li>
     <p class="simpara">Right-click on the &quot;Web Sites&quot; node in the tree view and select &quot;Properties&quot;;</p>
    </li>
    <li>
     <p class="simpara">Click the &quot;Documents&quot; tab;</p>
    </li>
    <li>
     <p class="simpara">Click the &quot;Add...&quot; button and enter &quot;index.php&quot; for the &quot;Default content page:&quot;.</p>
    </li>
   </ol></div>
   <div class="mediaobject">
    
    <div class="imageobject">
     <img src="images/b4cf2bb34e3c20eebcf8f9e8e7949efd-iis6defaultdoc.png" alt="Setting index.php as default document for IIS" width="659" height="465" />
    </div>
   </div>
  </p>
 </div>
 <div class="sect2" id="install.windows.iis6.recycling">
  <h3 class="title">FastCGI and PHP Recycling configuration</h3>
  <p class="para">
   Configure IIS FastCGI extension settings for recycling of PHP processes by using the commands shown below. 
   The FastCGI setting <var class="varname"><var class="varname">instanceMaxRequests</var></var> controls how many requests will be processed by a single 
   <var class="filename">php-cgi.exe</var> process before FastCGI extension shuts it down. The PHP environment variable 
   <var class="varname"><var class="varname">PHP_FCGI_MAX_REQUESTS</var></var> controls how many requests a single <var class="filename">php-cgi.exe</var> process 
   will handle before it recycles itself. Make sure that the value specified for FastCGI <var class="varname"><var class="varname">InstanceMaxRequests</var></var>
   setting is less than or equal to the value specified for <var class="varname"><var class="varname">PHP_FCGI_MAX_REQUESTS</var></var>.
   <div class="example" id="example-39">
    <p><strong>Example #4 Configuring FastCGI and PHP recycling</strong></p>
    <div class="example-contents">
<div class="cdata"><pre>
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:&quot;PHP&quot; ^
-InstanceMaxRequests:10000

cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:&quot;PHP&quot; ^
-EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000
</pre></div>     
    </div>

   </div>
  </p>
 </div>
 <div class="sect2" id="install.windows.iis6.timeouts">
  <h3 class="title">Configuring FastCGI timeout settings</h3>
  <p class="para">
   Increase the timeout settings for FastCGI extension if there are applications that have long running PHP scripts. 
   The two settings that control timeouts are <var class="varname"><var class="varname">ActivityTimeout</var></var> and <var class="varname"><var class="varname">RequestTimeout</var></var>. 
   Refer to <a href="http://learn.iis.net/page.aspx/248/configuring-fastcgi-extension-for-iis-60/" class="link external">&raquo;&nbsp;Configuring FastCGI Extension for IIS 6.0</a> for more 
   information about those settings.
   <div class="example" id="example-40">
    <p><strong>Example #5 Configuring FastCGI timeout settings</strong></p>
    <div class="example-contents">
<div class="cdata"><pre>
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:&quot;PHP&quot; ^
-ActivityTimeout:90

cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:&quot;PHP&quot; ^
-RequestTimeout:90
</pre></div>     
    </div>

   </div>
   </p>
 </div>
 <div class="sect2" id="install.windows.iis6.phpinilocation">
  <h3 class="title">Changing the Location of <var class="filename">php.ini</var> file</h3>
  <p class="para">
   PHP searches for <var class="filename">php.ini</var> file in 
   <a href="configuration.file.html" class="link">several locations</a> and it is 
   possible to change the default locations of <var class="filename">php.ini</var> 
   file by using <var class="varname"><var class="varname">PHPRC</var></var> environment variable. To instruct PHP 
   to load the configuration file from a custom location run the command shown below. 
   The absolute path to the directory with <var class="filename">php.ini</var> file should be 
   specified as a value of <var class="varname"><var class="varname">PHPRC</var></var> environment variable.
   <div class="example" id="example-41">
    <p><strong>Example #6 Changing the location of <var class="filename">php.ini</var> file</strong></p>
    <div class="example-contents">
<div class="cdata"><pre>
cscript %windir%\system32\inetsrv\fcgiconfig.js -set -section:&quot;PHP&quot; ^
-EnvironmentVars:PHPRC:&quot;C:\Some\Directory\&quot;
</pre></div>         
    </div>

   </div>
  </p>
 </div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.windows.iis.html">Microsoft IIS</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.windows.iis7.html">Microsoft IIS 7.0 and later</a></div>
 <div class="up"><a href="install.windows.html">Installation on Windows systems</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>