install/ini.xml
15841d188475e59c105f57c9022873f2cd7467b5
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<chapter xml:id="configuration" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
<chapter xml:id="configuration" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
4
4
<title>Runtime Configuration</title>
5
5

6
6
<sect1 xml:id="configuration.file">
...
...
@@ -19,26 +19,31 @@
19
19
<listitem>
20
20
<simpara>
21
21
SAPI module specific location (<literal>PHPIniDir</literal> directive
22
-
in Apache 2, <literal>-c</literal> command line option in CGI and CLI,
23
-
<literal>php_ini</literal> parameter in NSAPI,
24
-
<literal>PHP_INI_PATH</literal> environment variable in THTTPD)
22
+
in Apache 2, <literal>-c</literal> command line option in CGI and CLI)
25
23
</simpara>
26
24
</listitem>
27
25
<listitem>
28
26
<simpara>
29
-
The <varname>PHPRC</varname> environment variable. Before PHP 5.2.0,
30
-
this was checked after the registry key mentioned below.
27
+
The <varname>PHPRC</varname> environment variable.
31
28
</simpara>
32
29
</listitem>
33
30
<listitem>
34
31
<simpara>
35
-
As of PHP 5.2.0, the location of the <literal>php.ini</literal> file
36
-
can be set for different versions of PHP. The following registry keys
32
+
The location of the <literal>php.ini</literal> file
33
+
can be set for different versions of PHP. The root of the registry keys depends on 32- or 64-bitness of the installed OS and PHP.
34
+
For 32-bit PHP on a 32-bit OS or a 64-bit PHP on a 64-bit OS use <literal>[(HKEY_LOCAL_MACHINE\SOFTWARE\PHP]</literal> for 32-bit version of PHP on a 64-bit OS use <literal>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP]</literal>] instead.
35
+
For same bitness installation the following registry keys
37
36
are examined in order:
38
37
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z]</literal>,
39
38
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y]</literal> and
40
39
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x]</literal>, where
41
-
x, y and z mean the PHP major, minor and release versions. If there is a
40
+
x, y and z mean the PHP major, minor and release versions.
41
+
For 32 bit versions of PHP on a 64 bit OS the following registry keys are examined in order:
42
+
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x.y.z]</literal>,
43
+
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x.y]</literal> and
44
+
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6421Node\PHP\x]</literal>, where
45
+
x, y and z mean the PHP major, minor and release versions.
46
+
If there is a
42
47
value for <literal>IniFilePath</literal> in any of these keys, the first
43
48
one found will be used as the location of the <literal>php.ini</literal>
44
49
(Windows only).
...
...
@@ -46,7 +51,8 @@
46
51
</listitem>
47
52
<listitem>
48
53
<simpara>
49
-
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\PHP]</literal>, value of
54
+
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\PHP]</literal> or
55
+
<literal>[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PHP]</literal>, value of
50
56
<literal>IniFilePath</literal> (Windows only).
51
57
</simpara>
52
58
</listitem>
...
...
@@ -130,7 +136,7 @@ include_path = ".;c:\php\lib"
130
136
</example>
131
137
</para>
132
138
<para>
133
-
Since PHP 5.1.0, it is possible to refer to existing .ini variables from
139
+
It is possible to refer to existing .ini variables from
134
140
within .ini files. Example: <literal>open_basedir = ${open_basedir}
135
141
":/new/dir"</literal>.
136
142
</para>
...
...
@@ -140,8 +146,8 @@ include_path = ".;c:\php\lib"
140
146
<para>
141
147
It is possible to configure PHP to scan for .ini files in a directory
142
148
after reading &php.ini;. This can be done at compile time by setting the
143
-
<option role="configure">--with-config-file-scan-dir</option> option. In
144
-
PHP 5.2.0 and later, the scan directory can then be overridden at run time
149
+
<option role="configure">--with-config-file-scan-dir</option> option.
150
+
The scan directory can then be overridden at run time
145
151
by setting the <varname>PHP_INI_SCAN_DIR</varname> environment variable.
146
152
</para>
147
153

...
...
@@ -187,60 +193,16 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
187
193
</screen>
188
194
</informalexample>
189
195
</sect2>
190
-
<sect2 xml:id="configuration.file.changelog">
191
-
&reftitle.changelog;
192
-

193
-
<para>
194
-
<informaltable>
195
-
<tgroup cols="2">
196
-
<thead>
197
-
<row>
198
-
<entry>&Version;</entry>
199
-
<entry>&Description;</entry>
200
-
</row>
201
-
</thead>
202
-
<tbody>
203
-
<row>
204
-
<entry>7.0.0</entry>
205
-
<entry>
206
-
Hash marks (<literal>#</literal>) are no longer recognized as comments.
207
-
</entry>
208
-
</row>
209
-
<row>
210
-
<entry>5.3.0</entry>
211
-
<entry>
212
-
Hash marks (<literal>#</literal>) should no longer be used as comments
213
-
and will throw a deprecation warning if used.
214
-
</entry>
215
-
</row>
216
-
<row>
217
-
<entry>5.2.0</entry>
218
-
<entry>
219
-
The <varname>PHP_INI_SCAN_DIR</varname> environment variable can be
220
-
set to override the scan directory set via the configure script.
221
-
</entry>
222
-
</row>
223
-
<row>
224
-
<entry>5.1.0</entry>
225
-
<entry>
226
-
It is possible to refer to existing .ini variables from within .ini files.
227
-
</entry>
228
-
</row>
229
-
</tbody>
230
-
</tgroup>
231
-
</informaltable>
232
-
</para>
233
-
</sect2>
234
196
</sect1>
235
197

236
198
<sect1 xml:id="configuration.file.per-user">
237
199
<title>.user.ini files</title>
238
200

239
201
<simpara>
240
-
Since PHP 5.3.0, PHP includes support for configuration INI files on a
202
+
PHP includes support for configuration INI files on a
241
203
per-directory basis. These files are processed <emphasis>only</emphasis> by
242
204
the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner
243
-
extension. If you are using Apache, use &htaccess; files for the same
205
+
extension. If you are running PHP as Apache module, use &htaccess; files for the same
244
206
effect.
245
207
</simpara>
246
208

...
...
@@ -253,30 +215,26 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
253
215
</simpara>
254
216
<simpara>
255
217
Only INI settings with the
256
-
modes <constant>PHP_INI_PERDIR</constant> and
257
-
<constant>PHP_INI_USER</constant> will be recognized in .user.ini-style INI
218
+
modes <constant>INI_PERDIR</constant> and
219
+
<constant>INI_USER</constant> will be recognized in .user.ini-style INI
258
220
files.
259
221
</simpara>
260
222

261
223
<simpara>
262
224
Two new INI directives,
263
-
<literal>user_ini.filename</literal> and
264
-
<literal>user_ini.cache_ttl</literal>
265
-
<!--
266
-
<link linkend="ini.user-ini.filename">user_ini.filename</link> and
267
-
<link linkend="ini.user-ini.cache-ttl">user_ini.cache_ttl</link>
268
-
-->
225
+
<link linkend="ini.user-ini.filename">user_ini.filename</link> and
226
+
<link linkend="ini.user-ini.cache-ttl">user_ini.cache_ttl</link>
269
227
control the use of user INI files.
270
228
</simpara>
271
229

272
230
<simpara>
273
-
<literal>user_ini.filename</literal> sets the name of the file PHP looks for
231
+
<link linkend="ini.user-ini.filename">user_ini.filename</link> sets the name of the file PHP looks for
274
232
in each directory; if set to an empty string, PHP doesn't scan at all. The
275
233
default is <literal>.user.ini</literal>.
276
234
</simpara>
277
235

278
236
<simpara>
279
-
<literal>user_ini.cache_ttl</literal> controls how often user INI files are
237
+
<link linkend="ini.user-ini.cache-ttl">user_ini.cache_ttl</link> controls how often user INI files are
280
238
re-read. The default is 300 seconds (5 minutes).
281
239
</simpara>
282
240
</sect1>
...
...
@@ -295,49 +253,16 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
295
253
<para>
296
254
For example, the
297
255
<link linkend="ini.output-buffering">output_buffering</link> setting
298
-
is <literal>PHP_INI_PERDIR</literal> therefore it may not be set using
256
+
is <constant>INI_PERDIR</constant> therefore it may not be set using
299
257
<function>ini_set</function>. However, the
300
258
<link linkend="ini.display-errors">display_errors</link> directive is
301
-
<literal>PHP_INI_ALL</literal> therefore it may be set anywhere,
259
+
<constant>INI_ALL</constant> therefore it may be set anywhere,
302
260
including with <function>ini_set</function>.
303
261
</para>
304
262

305
263
<para>
306
264
<table>
307
-
<title>Definition of PHP_INI_* modes</title>
308
-
<tgroup cols="2">
309
-
<thead>
310
-
<row>
311
-
<entry>Mode</entry>
312
-
<entry>Meaning</entry>
313
-
</row>
314
-
</thead>
315
-
<tbody>
316
-
<row>
317
-
<entry><literal>PHP_INI_USER</literal></entry>
318
-
<entry>
319
-
Entry can be set in user scripts (like with <function>ini_set</function>)
320
-
or in the <link linkend="configuration.changes.windows">Windows registry</link>.
321
-
Since PHP 5.3, entry can be set in &user-ini;
322
-
</entry>
323
-
</row>
324
-
<row>
325
-
<entry><literal>PHP_INI_PERDIR</literal></entry>
326
-
<entry>
327
-
Entry can be set in &php.ini;, &htaccess;, &httpd.conf; or &user-ini;
328
-
(since PHP 5.3)
329
-
</entry>
330
-
</row>
331
-
<row>
332
-
<entry><literal>PHP_INI_SYSTEM</literal></entry>
333
-
<entry>Entry can be set in &php.ini; or &httpd.conf;</entry>
334
-
</row>
335
-
<row>
336
-
<entry><literal>PHP_INI_ALL</literal></entry>
337
-
<entry>Entry can be set anywhere</entry>
338
-
</row>
339
-
</tbody>
340
-
</tgroup>
265
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('constant.ini-mode')/*)"><xi:fallback/></xi:include>
341
266
</table>
342
267
</para>
343
268
</sect1>
...
...
@@ -358,8 +283,8 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
358
283
There are several Apache directives that allow you
359
284
to change the PHP configuration from within the Apache configuration
360
285
files. For a listing of which directives are
361
-
<constant>PHP_INI_ALL</constant>, <constant>PHP_INI_PERDIR</constant>,
362
-
or <constant>PHP_INI_SYSTEM</constant>, have a look at the
286
+
<constant>INI_ALL</constant>, <constant>INI_PERDIR</constant>,
287
+
or <constant>INI_SYSTEM</constant>, have a look at the
363
288
<link linkend="ini.list">List of php.ini directives</link> appendix.
364
289
</para>
365
290

...
...
@@ -374,7 +299,7 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
374
299
<listitem>
375
300
<para>
376
301
Sets the value of the specified directive.
377
-
Can be used only with <constant>PHP_INI_ALL</constant> and <constant>PHP_INI_PERDIR</constant> type directives.
302
+
Can be used only with <constant>INI_ALL</constant> and <constant>INI_PERDIR</constant> type directives.
378
303
To clear a previously set value use <literal>none</literal> as the value.
379
304
</para>
380
305
<note>
...
...
@@ -394,8 +319,8 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
394
319
<listitem>
395
320
<para>
396
321
Used to set a boolean configuration directive.
397
-
Can be used only with <constant>PHP_INI_ALL</constant> and
398
-
<constant>PHP_INI_PERDIR</constant> type directives.
322
+
Can be used only with <constant>INI_ALL</constant> and
323
+
<constant>INI_PERDIR</constant> type directives.
399
324
</para>
400
325
</listitem>
401
326
</varlistentry>
...
...
@@ -478,8 +403,9 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
478
403
should have the name of the PHP configuration directive and the
479
404
string value. PHP constants in the values are not parsed.
480
405
However, only configuration values changeable in
481
-
<constant>PHP_INI_USER</constant> can be set
482
-
this way, <constant>PHP_INI_PERDIR</constant> values can not.
406
+
<constant>INI_USER</constant> can be set
407
+
this way, <constant>INI_PERDIR</constant> values can not,
408
+
because these configuration values are re-read for each request.
483
409
</simpara>
484
410
</sect2>
485
411

486
412