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 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Revision: 289710 $ -->
<sect1 xml:id="install.windows.manual" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Manual Installation Steps</title>
<para>
This section contains instructions for manually installing and configuring
PHP on Microsoft Windows. For the instructions on how to use PHP installer to
setup and configure PHP and a web server on Windows refer to
<link linkend="install.windows.installer.msi">Windows Installer (PHP 5.2 and later)</link>.
</para>
<sect2 xml:id="install.windows.manual.download">
<title>Selecting and downloading the PHP distribution package</title>
<para>
Download the PHP zip binary distribution from
<link xlink:href="&url.php.win.downloads;">PHP for Windows: Binaries and Sources</link>.
There are several different versions of the zip package - chose the version that is suitable for
the web server being used:
<itemizedlist spacing="compact">
<listitem>
<para>
If PHP is used with IIS then choose PHP 5.3 <emphasis>VC9 Non Thread Safe</emphasis> or
PHP 5.2 <emphasis>VC6 Non Thread Safe</emphasis>;
</para>
</listitem>
<listitem>
<para>
If PHP is used with Apache 1 or Apache 2 then choose PHP 5.3 <emphasis>VC6</emphasis> or
PHP 5.2 <emphasis>VC6</emphasis>.
</para>
</listitem>
</itemizedlist>
<note>
<para>
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements
in performance and stability. The VC9 versions require you to have the
<link xlink:href="&url.microsoft.vc9.x86;">Microsoft 2008 C++ Runtime (x86)</link> or
the <link xlink:href="&url.microsoft.vc9.x64;">Microsoft 2008 C++ Runtime (x64)</link> installed.
</para>
</note>
</para>
</sect2>
<sect2 xml:id="install.windows.manual.package">
<title>The PHP package structure and content</title>
<para>
Unpack the content of the zip archive into a directory of your choice, for
example C:\PHP\. The directory and file structure extracted from the zip will
look as below:
<example>
<title>PHP 5 package structure</title>
<programlisting>
<![CDATA[
c:\php
|
+--dev
| |
| |-php5ts.lib -- php5.lib in non thread safe version
|
+--ext -- extension DLLs for PHP
| |
| |-php_bz2.dll
| |
| |-php_cpdf.dll
| |
| |-...
|
+--extras -- empty
|
+--pear -- initial copy of PEAR
|
|
|-go-pear.bat -- PEAR setup script
|
|-...
|
|-php-cgi.exe -- CGI executable
|
|-php-win.exe -- executes scripts without an opened command prompt
|
|-php.exe -- Command line PHP executable (CLI)
|
|-...
|
|-php.ini-development -- default php.ini settings
|
|-php.ini-production -- recommended php.ini settings
|
|-php5apache2_2.dll -- does not exist in non thread safe version
|
|-php5apache2_2_filter.dll -- does not exist in non thread safe version
|
|-...
|
|-php5ts.dll -- core PHP DLL ( php5.dll in non thread safe version)
|
|-...
]]>
</programlisting>
</example>
</para>
<para>
Below is the list of the modules and executables included in the PHP zip
distribution:
<itemizedlist spacing="compact">
<listitem>
<para>
<filename>go-pear.bat</filename> - the PEAR setup script. Refer to <link xlink:href="&url.pear.installation;">Installation (PEAR)</link>
for more details.
</para>
</listitem>
<listitem>
<para>
<filename>php-cgi.exe</filename> - CGI executable that can be used when running PHP on IIS via CGI or FastCGI.
</para>
</listitem>
<listitem>
<para>
<filename>php-win.exe</filename> - the PHP executable for executing PHP scripts without using a command line window
(for example PHP applications that use Windows GUI).
</para>
</listitem>
<listitem>
<para>
<filename>php.exe</filename> - the PHP executable for executing PHP scripts within a command line interface (CLI).
</para>
</listitem>
<listitem>
<para>
<filename>php5apache2_2.dll</filename> - Apache 2.2.X module.
</para>
</listitem>
<listitem>
<para>
<filename>php5apache2_2_filter.dll</filename> - Apache 2.2.X filter.
</para>
</listitem>
</itemizedlist>
</para>
</sect2>
<sect2 xml:id="install.windows.manual.phpini">
<title>Changing the <filename>php.ini</filename> file</title>
<para>
After the php package content has been extracted, copy the <filename>php.ini-production</filename> into <filename>php.ini</filename>
in the same folder. If necessary, it is also possible to place the <filename>php.ini</filename> into any other location of your choice
but that will require additional configuration steps as described in <link linkend="configuration.file">PHP Configuration</link>.
</para>
<para>
The <filename>php.ini</filename> file tells PHP how to configure itself, and how to work with the
environment that it runs in. Here are a number of settings for the <filename>php.ini</filename> file
that help PHP work better with Windows. Some of these are optional. There are
many other directives that may be relevant to your environment - refer to the
<link linkend="ini.list">list of php.ini directives</link> for more information.
</para>
<para>
Required directives:
<itemizedlist spacing="compact">
<listitem>
<para>
<varname>extension_dir</varname> = <literal><path to extension directory></literal> - The <varname>extension_dir</varname> needs
to point to the directory where PHP extensions files are stored. The path can be absolute
(i.e. "C:\PHP\ext") or relative (i.e. ".\ext"). Extensions that are listed lower in the <filename>php.ini</filename> file need
to be located in the <varname>extension_dir</varname>.
</para>
</listitem>
<listitem>
<para>
<varname>extension</varname> = <literal>xxxxx.dll</literal> - For each extension you wish to enable, you need a corresponding "extension="
directive that tells PHP which extensions in the <varname>extension_dir</varname> to load at startup time.
</para>
</listitem>
<listitem>
<para>
<varname>log_errors</varname> = <literal>On</literal> - PHP has an error logging facility that can be used to send errors to a file,
or to a service (i.e. syslog) and works in conjunction with the <varname>error_log</varname> directive below. When running under IIS,
the <varname>log_errors</varname> should be enabled, with a valid <varname>error_log</varname>.
</para>
</listitem>
<listitem>
<para>
<varname>error_log</varname> = <literal><path to the error log file></literal> - The error_log needs to specify the absolute,
or relative path to the file where PHP errors should be logged. This file needs to be writable for the web server.
The most common places for this file are in various TEMP directories, for example "C:\inetpub\temp\php-errors.log".
</para>
</listitem>
<listitem>
<para>
<varname>cgi.force_redirect</varname> = <literal>0</literal> - This directive is required for running under IIS.
It is a directory security facility required by many other web servers. However, enabling it under IIS will
cause the PHP engine to fail on Windows.
</para>
</listitem>
<listitem>
<para>
<varname>cgi.fix_pathinfo</varname> = <literal>1</literal> - This lets PHP access real path info following the CGI Spec.
The IIS FastCGI implementation needs this set.
</para>
</listitem>
<listitem>
<para>
<varname>fastcgi.impersonate</varname> = <literal>1</literal> - FastCGI under IIS supports the ability to impersonate
security tokens of the calling client. This allows IIS to define the security context that the request runs under.
</para>
</listitem>
<listitem>
<para>
<varname>fastcgi.logging</varname> = <literal>0</literal> - FastCGI logging should be disabled on IIS. If it is left enabled,
then any messages of any class are treated by FastCGI as error conditions which will cause IIS to generate an HTTP 500 exception.
</para>
</listitem>
</itemizedlist>
</para>
<para>
Optional directives
<itemizedlist spacing="compact">
<listitem>
<para>
<varname>max_execution_time</varname> = <literal>##</literal> - This directive tells PHP the maximum amount of time that it can spend
executing any given script. The default for this is 30 seconds. Increase the value of this directive if PHP application take long time to execute.
</para>
</listitem>
<listitem>
<para>
<varname>memory_limit</varname> = <literal>###M</literal> - The amount of memory available for the PHP process, in Megabytes.
The default is 128, which is fine for most PHP applications. Some of the more complex ones might need more.
</para>
</listitem>
<listitem>
<para>
<varname>display_errors</varname> = <literal>Off</literal> - This directive tells PHP whether to include any error messages in the
stream that it returns to the Web server. If this is set to "On", then PHP will send whichever classes of errors
that you define with the <varname>error_reporting</varname> directive back to web server as part of the error stream.
For security reasons it is recommended to set it to "Off" on production servers in order not to reveal any
security sensitive information that is often included in the error messages.
</para>
</listitem>
<listitem>
<para>
<varname>open_basedir</varname> = <literal><paths to directories, separated by semicolon></literal>, e.g.
openbasedir="C:\inetpub\wwwroot;C:\inetpub\temp". This directive specified the directory paths where PHP
is allowed to perform file system operations. Any file operation outside of the specified paths will result in an error.
This directive is especially useful for locking down the PHP installation in shared hosting environments to prevent
PHP scripts from accessing any files outside of the web site's root directory.
</para>
</listitem>
<listitem>
<para>
<varname>upload_max_filesize</varname> = <literal>###M</literal> and <varname>post_max_size</varname> = <literal>###M</literal> -
The maximum allowed size of an uploaded file and post data respectively. The values of these directives should be
increased if PHP applications need to perform large uploads, such as for example photos or video files.
</para>
</listitem>
</itemizedlist>
</para>
<para>
PHP is now setup on your system. The next step is to choose a web
server, and enable it to run PHP. Choose a web server from the table of
contents.
</para>
<para>
In addition to running PHP via a web server, PHP can run from the command
line just like a <literal>.BAT</literal> script. See
<link linkend="install.windows.commandline">Command Line PHP on Microsoft
Windows</link> for further details.
</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:"~/.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
-->
|