Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 8230

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>Apache 2.x on Microsoft Windows</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.windows.apache1.html">Apache 1.3.x on Microsoft Windows</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.windows.sun.html">Sun, iPlanet and Netscape servers on Microsoft Windows</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.apache2" class="sect1">
    <h2 class="title">Apache 2.x on Microsoft Windows</h2>
    <p class="para">
     This section contains notes and hints specific to Apache 2.x installs
     of PHP on Microsoft Windows systems. We also
     have <a href="install.windows.apache1.html" class="link">instructions and notes
     for Apache 1.3.x users on a separate page</a>.
    </p>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      You should read the <a href="install.windows.manual.html" class="link">manual
       installation steps</a> first!
     </p>
    </p></blockquote>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <strong>Apache 2.2 Support</strong><br />
     <p class="para">
      Users of Apache 2.2 should note that the DLL file for Apache 2.2 is
      named <var class="filename">php5apache2_2.dll</var> rather than <var class="filename">php5apache2.dll</var>
      and is available only for PHP 5.2.0 and later.
      See also <a href="http://snaps.php.net/" class="link external">&raquo;&nbsp;http://snaps.php.net/</a>
     </p>
    </p></blockquote>
    
    <p class="para">
     You are strongly encouraged to consult the
     <a href="http://httpd.apache.org/docs/current/" class="link external">&raquo;&nbsp;Apache Documentation</a> to get
     a basic understanding of the Apache 2.x Server. Also consider
     reading the <a href="http://httpd.apache.org/docs/current/platform/windows.html" class="link external">&raquo;&nbsp;Windows specific
     notes</a> for Apache 2.x before reading on here.
    </p>
    
     <p class="para">
      Apache 2.x is designed to run on the Windows version designated as
      server platforms, such as Windows NT 4.0, Windows 2000,
      Windows XP, or Windows 7. While Apache 2.x works tolerably well on Windows 9x,
      support on these platforms is incomplete, and some things will not work
      correctly. There is no plan to remedy this situation.
     </p>

    <p class="para">
     Download the most recent version of <a href="http://httpd.apache.org/" class="link external">&raquo;&nbsp;
     Apache 2.x</a> and a fitting PHP version.
     Follow the <a href="install.windows.manual.html" class="link">Manual Installation
     Steps</a> and come back to go on with the integration of PHP and Apache.
    </p>

    <p class="para">
     There are three ways to set up PHP to work with Apache 2.x on Windows.
     You can run PHP as a handler, as a CGI, or under FastCGI.
    </p>
    
    <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">Remember that when adding
path values in the Apache configuration files on Windows, all backslashes
such as <var class="filename">c:\directory\file.ext</var> should be converted to
forward slashes: <var class="filename">c:/directory/file.ext</var>. A trailing
slash may also be necessary for directories.</span></p></blockquote>
    
    <div class="sect2" id="install.windows.apache2.module">
     <h3 class="title">Installing as an Apache handler</h3>
     <p class="para">
      You need to insert the following lines into your
      Apache <var class="filename">httpd.conf</var> configuration file to load the
      PHP module for Apache 2.x:
      <div class="example" id="example-53">
       <p><strong>Example #1 PHP and Apache 2.x as handler</strong></p>
        <div class="example-contents">
<div class="apache-confcode"><pre class="apache-confcode"># 
LoadModule php5_module &quot;c:/php/php5apache2.dll&quot;
AddHandler application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir &quot;C:/php&quot;</pre>
</div>
       </div>

      </div>
     </p>
     <blockquote class="note"><p><strong class="note">Note</strong>: 
      <span class="simpara">
       Remember to substitute your actual path to PHP for the
       <var class="filename">C:/php/</var> in the above examples. Take care to use
       either <var class="filename">php5apache2.dll</var> or 
       <var class="filename">php5apache2_2.dll</var> in your LoadModule directive and
       verify that the referenced file is in fact located at the file path
       that you point to in this directive.
      </span>
     </p></blockquote>
      <p class="para">
      The above configuration will enable PHP handling of any file that has a
      .php extension, even if there are other file extensions. For example, a
      file named <var class="filename">example.php.txt</var> will be executed by the
      PHP handler. To ensure that only files that <em class="emphasis">end in</em>
      <var class="filename">.php</var> are executed, use the following configuration
      instead:
      </p>

      <div class="example" id="example-54">
        <div class="example-contents">
<div class="apache-confcode"><pre class="apache-confcode">&lt;FilesMatch \.php$&gt;
      SetHandler application/x-httpd-php
 &lt;/FilesMatch&gt;</pre>
</div>
       </div>

      </div>
    </div>

    <div class="sect2" id="install.windows.apache2.cgi">
     <h3 class="title">Running PHP as CGI</h3>

     <p class="para">
      You should consult the <a href="http://httpd.apache.org/docs/current/howto/cgi.html" class="link external">&raquo;&nbsp;Apache CGI
      documentation</a> for a more complete understanding of running CGI
      on Apache.
     </p>
   
     <p class="para">
      To run PHP as CGI, you&#039;ll need to place your php-cgi files in a
      directory designated as a CGI directory using the ScriptAlias directive.
     </p>

     <p class="para">
      You will then need to insert a #! line in the PHP files, pointing to the
      location of your PHP binary:

      <div class="example" id="example-55">
       <p><strong>Example #2 PHP and Apache 2.x as CGI</strong></p>
        <div class="example-contents">
<div class="cdata"><pre>
#!C:/php/php.exe
&lt;?php
  phpinfo();
?&gt;
</pre></div>
       </div>

      </div>
     </p>
     <div class="warning"><strong class="warning">Warning</strong><p class="para">A server deployed in CGI mode is open
to several possible vulnerabilities. Please read our
<a href="security.cgi-bin.html" class="link">CGI security section</a> to learn how to
defend yourself from such attacks.</p></div>
    </div>

    <div class="sect2" id="install.windows.apache2.fastcgi">
     <h3 class="title">Running PHP under FastCGI</h3>

     <p class="para">
     Running PHP under FastCGI has a number of advantages over running it as a
     CGI. Setting it up this way is fairly straightforward:
     </p>
     <p class="para">
     Obtain mod_fcgid from 
     <a href="http://httpd.apache.org/mod_fcgid/" class="link external">&raquo;&nbsp;http://httpd.apache.org/mod_fcgid/</a>. Win32
     binaries are available for download from that site. Install the module
     according to the instructions that will come with it.
     </p>
     <p class="para">
     Configure your web server as shown below, taking care to adjust any paths
     to reflect your how you have installed things on your particular system:

     <div class="example" id="example-56">
     <p><strong>Example #3 Configure Apache to run PHP as FastCGI</strong></p>
     <div class="example-contents">
<div class="cdata"><pre>
LoadModule fcgid_module modules/mod_fcgid.so  

# Where is your php.ini file?
FcgidInitialEnv PHPRC        &quot;c:/php&quot; 

AddHandler fcgid-script .php  
FcgidWrapper &quot;c:/php/php-cgi.exe&quot; .php  
</pre></div>
     </div>

     </div>

     Files with a .php extension will now be executed by the PHP FastCGI
     wrapper.
     </p>

    </div>

   </div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="install.windows.apache1.html">Apache 1.3.x on Microsoft Windows</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="install.windows.sun.html">Sun, iPlanet and Netscape servers on Microsoft Windows</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>