mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-17 01:18:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@147050 c90b9560-bf6c-de11-be94-00142212c4b1
362 lines
12 KiB
XML
362 lines
12 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.6 $ -->
|
|
<sect1 id="install.iis">
|
|
<title>Servers-IIS/PWS</title>
|
|
<para>
|
|
This section contains notes and hints specific to IIS (Microsoft
|
|
Internet Information Server). Installing PHP for
|
|
<link linkend="install.iis.iis3">PWS/IIS 3</link>,
|
|
<link linkend="install.iis.pws4">PWS 4 or newer</link> and
|
|
<link linkend="install.iis.iis4">IIS 4 or newer</link> versions.
|
|
</para>
|
|
|
|
<note>
|
|
<title>Important for CGI users</title>
|
|
<para>
|
|
Read the <link linkend="faq.installation.forceredirect">faq
|
|
on cgi.force_redirect</link> for important details. This
|
|
directive needs to be set to <literal>0</literal>.
|
|
</para>
|
|
</note>
|
|
|
|
<sect2 id="install.iis.iis3">
|
|
<title>Windows and PWS/IIS 3</title>
|
|
|
|
<simpara>
|
|
The recommended method for configuring these servers is to use
|
|
the REG file included with the distribution
|
|
(pws-php4cgi.reg). You may want to edit this file and make sure
|
|
the extensions and PHP install directories match your
|
|
configuration. Or you can follow the steps below to do it
|
|
manually.
|
|
</simpara>
|
|
<warning>
|
|
<para>
|
|
These steps involve working directly with the Windows
|
|
registry. One error here can leave your system in an unstable
|
|
state. We highly recommend that you back up your registry
|
|
first. The PHP Development team will not be held responsible if
|
|
you damage your registry.
|
|
</para>
|
|
</warning>
|
|
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Run Regedit.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Navigate to: <literal>HKEY_LOCAL_MACHINE /System
|
|
/CurrentControlSet /Services /W3Svc /Parameters
|
|
/ScriptMap</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
On the edit menu select: <literal>New->String Value</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Type in the extension you wish to use for your php
|
|
scripts. For example <literal>.php</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Double click on the new string value and enter the path to
|
|
<literal>php.exe</literal> in the value data field. ex:
|
|
<literal>c:\php\php.exe</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Repeat these steps for each extension you wish to associate
|
|
with PHP scripts.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<para>
|
|
The following steps do not affect the web server installation
|
|
and only apply if you want your PHP scripts to be executed when
|
|
they are run from the command line (ex. run
|
|
<filename>c:\myscripts\test.php</filename>) or by double clicking
|
|
on them in a directory viewer window. You may wish to skip these
|
|
steps as you might prefer the PHP files to load into a text
|
|
editor when you double click on them.
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Navigate to: <literal>HKEY_CLASSES_ROOT</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
On the edit menu select: <literal>New->Key</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Name the key to the extension you setup in the previous
|
|
section. ex: <literal>.php</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Highlight the new key and in the right side pane, double click
|
|
the "default value" and enter <literal>phpfile</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Repeat the last step for each extension you set up in the
|
|
previous section.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Now create another <literal>New->Key</literal> under
|
|
<literal>HKEY_CLASSES_ROOT</literal> and name it
|
|
<literal>phpfile</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Highlight the new key <literal>phpfile</literal> and in the
|
|
right side pane, double click the "default value" and enter
|
|
<literal>PHP Script</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Right click on the <literal>phpfile</literal> key and select
|
|
<literal>New->Key</literal>, name it <literal>Shell</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Right click on the <literal>Shell</literal> key and select
|
|
<literal>New->Key</literal>, name it <literal>open</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Right click on the <literal>open</literal> key and select
|
|
<literal>New->Key</literal>, name it
|
|
<literal>command</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Highlight the new key <literal>command</literal> and in the
|
|
right side pane, double click the "default value" and enter
|
|
the path to <literal>php.exe</literal>. ex:
|
|
<literal>c:\php\php.exe -q %1</literal>. (don't forget the
|
|
<literal>%1</literal>).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Exit Regedit.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
If using PWS on Windows, reboot to reload the registry.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<simpara>
|
|
PWS and IIS 3 users now have a fully operational system. IIS 3
|
|
users can use a nifty <ulink url="&url.iiscfg;">tool</ulink>
|
|
from Steven Genusa to configure their script maps.
|
|
</simpara>
|
|
|
|
</sect2>
|
|
|
|
<sect2 id="install.iis.pws4">
|
|
<title>Windows and PWS 4 or newer</title>
|
|
|
|
<simpara>
|
|
When installing PHP on Windows with PWS 4 or newer version,
|
|
you have two options. One to set up the PHP CGI binary,
|
|
the other is to use the ISAPI module DLL.
|
|
</simpara>
|
|
|
|
<para>
|
|
If you choose the CGI binary, do the following:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Edit the enclosed <filename>pws-php4cgi.reg</filename>
|
|
file (look into the SAPI dir) to reflect the location of
|
|
your <filename>php.exe</filename>. Backslashes should be
|
|
escaped, for example:
|
|
<literal>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] ".php"="c:\\php\\php.exe"</literal>
|
|
Now merge this registery file into your system; you may do
|
|
this by double-clicking it.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
In the PWS Manager, right click on a given directory you want
|
|
to add PHP support to, and select Properties. Check the 'Execute'
|
|
checkbox, and confirm.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
|
|
<para>
|
|
If you choose the ISAPI module, do the following:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Edit the enclosed <filename>pws-php4isapi.reg</filename>
|
|
file (look into the SAPI dir) to reflect the location of
|
|
your <filename>php4isapi.dll</filename>. Backslashes should
|
|
be escaped, for example:
|
|
<literal>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w3svc\parameters\Script Map] ".php"="c:\\php\\sapi\\php4isapi.dll"</literal>
|
|
Now merge this registery file into your system; you may do
|
|
this by double-clicking it.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
In the PWS Manager, right click on a given directory you want to
|
|
add PHP support to, and select Properties. Check the 'Execute'
|
|
checkbox, and confirm.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
<sect2 id="install.iis.iis4">
|
|
<title>Windows NT/2000/XP and IIS 4 or newer</title>
|
|
|
|
<simpara>
|
|
To install PHP on an NT/2000/XP Server running IIS 4 or newer,
|
|
follow these instructions. You have two options to set up
|
|
PHP, using the CGI binary (php.exe) or with the ISAPI module.
|
|
</simpara>
|
|
|
|
<simpara>
|
|
In either case, you need to start the Microsoft Management
|
|
Console (may appear as 'Internet Services Manager', either
|
|
in your Windows NT 4.0 Option Pack branch or the Control
|
|
Panel=>Administrative Tools under Windows 2000/XP). Then
|
|
right click on your Web server node (this will most probably
|
|
appear as 'Default Web Server'), and select 'Properties'.
|
|
</simpara>
|
|
|
|
<para>
|
|
If you want to use the CGI binary, do the following:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Under 'Home Directory', 'Virtual Directory', or
|
|
'Directory', click on the 'Configuration' button,
|
|
and then enter the App Mappings tab.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Click Add, and in the Executable box, type:
|
|
<literal>c:\php\php.exe</literal> (assuming
|
|
that you have unziped PHP in c:\php\).
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
In the Extension box, type the file name extension you want
|
|
associated with PHP scripts. Leave 'Method exclusions'
|
|
blank, and check the Script engine checkbox. You may also
|
|
like to check the 'check that file exists' box - for a small
|
|
performance penalty, IIS (or PWS) will check that the script
|
|
file exists and sort out authentication before firing up php.
|
|
This means that you will get sensible 404 style error messages
|
|
instead of cgi errors complaining that PHP did not output any data.
|
|
</simpara>
|
|
<simpara>
|
|
You must start over from the previous step for each
|
|
extension you want associated with PHP scripts.
|
|
<literal>.php</literal> and <literal>.phtml</literal>
|
|
are common, although <literal>.php3</literal> may be
|
|
required for legacy applications.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Set up the appropriate security. (This is done in Internet
|
|
Service Manager), and if your NT Server uses NTFS file system,
|
|
add execute rights for I_USR_ to the directory that contains
|
|
<literal>php.exe</literal>.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
|
|
<para>
|
|
To use the ISAPI module, do the following:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
If you don't want to perform HTTP Authentication using PHP,
|
|
you can (and should) skip this step. Under ISAPI Filters,
|
|
add a new ISAPI filter. Use PHP as the filter name, and
|
|
supply a path to the php4isapi.dll.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Under 'Home Directory', click on the 'Configuration' button.
|
|
Add a new entry to the Application Mappings. Use the path
|
|
to the php4isapi.dll as the Executable, supply
|
|
<literal>.php</literal> as the extension, leave Method
|
|
exclusions blank, and check the Script engine checkbox.
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Stop IIS completely (NET STOP iisadmin)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Start IIS again (NET START w3svc)
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</sect2>
|
|
</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:"../../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
|
|
-->
|