1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<!-- $Revision$ -->
3
- <!-- EN-Revision: 4eeb07225f615fcde68cbefb84df2fc9bf278f1f Maintainer: dallas Status: ready -->
4
- <!-- Reviewed: yes -->
5
- <chapter xml : id =" configuration" xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" >
3
+ <!-- EN-Revision: 15841d188475e59c105f57c9022873f2cd7467b5 Maintainer: dallas Status: ready -->
4
+ <!-- CREDITS: mowangjuanzi -->
5
+ <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 " >
6
6
<title >运行时配置</title >
7
-
7
+
8
8
<sect1 xml : id =" configuration.file" >
9
9
<title >配置文件</title >
10
-
10
+
11
11
<simpara >
12
12
配置文件(&php.ini; )在 PHP 启动时被读取。对于服务器模块版本的 PHP,仅在 web
13
13
服务器启动时读取一次。对于
@@ -192,17 +192,15 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
192
192
</informalexample >
193
193
</sect2 >
194
194
</sect1 >
195
-
195
+
196
196
<sect1 xml : id =" configuration.file.per-user" >
197
197
<title >.user.ini 文件</title >
198
-
198
+
199
199
<simpara >
200
200
PHP 支持基于每个目录的 INI 文件配置。此类文件
201
201
<emphasis >仅</emphasis >被 CGI/FastCGI SAPI 处理。此功能使得 PECL 的 htscanner
202
202
扩展作废。如果你的 PHP 以模块化运行在 Apache 里,则用 &htaccess; 文件有同样效果。
203
203
</simpara >
204
-
205
-
206
204
207
205
<simpara >
208
206
除了主 &php.ini; 之外,PHP 还会在每个目录下扫描 INI
@@ -215,38 +213,36 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
215
213
和 <constant >INI_USER</constant > 模式的 INI
216
214
设置可被识别。
217
215
</simpara >
218
-
219
-
220
216
221
217
<simpara >
222
218
两个新的 INI 指令,
223
219
<link linkend =" ini.user-ini.filename" >user_ini.filename</link > 和
224
220
<link linkend =" ini.user-ini.cache-ttl" >user_ini.cache_ttl</link >
225
221
控制着用户 INI 文件的使用。
226
222
</simpara >
227
-
223
+
228
224
<simpara >
229
225
<link linkend =" ini.user-ini.filename" >user_ini.filename</link > 设定了 PHP
230
226
会在每个目录下搜寻的文件名;如果设定为空字符串则 PHP
231
227
不会搜寻。默认值是 <literal >.user.ini</literal >。
232
228
</simpara >
233
-
229
+
234
230
<simpara >
235
231
<link linkend =" ini.user-ini.cache-ttl" >user_ini.cache_ttl</link > 控制着重新读取用户
236
232
INI 文件的间隔时间。默认是 300 秒(5 分钟)。
237
233
</simpara >
238
234
</sect1 >
239
-
235
+
240
236
<sect1 xml : id =" configuration.changes.modes" >
241
237
<title >配置可被设定范围</title >
242
-
238
+
243
239
<para >
244
240
这些模式决定着一个 PHP
245
241
的指令在何时何地,是否能够被设定。手册中的每个指令都有其所属的模式。例如有些指令可以在
246
242
PHP 脚本中用 <function >ini_set</function > 来设定,而有些则只能在
247
243
&php.ini; 或 &httpd.conf; 中。
248
244
</para >
249
-
245
+
250
246
<para >
251
247
例如
252
248
<link linkend =" ini.output-buffering" >output_buffering</link >
@@ -258,48 +254,17 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
258
254
<constant >INI_ALL</constant > 因而就可以在任何地方被设定,包括
259
255
<function >ini_set</function >。
260
256
</para >
261
-
257
+
262
258
<para >
263
259
<table >
264
- <title >INI_* 模式的定义</title >
265
- <tgroup cols =" 3" >
266
- <thead >
267
- <row >
268
- <entry >模式</entry >
269
- <entry >含义</entry >
270
- </row >
271
- </thead >
272
- <tbody >
273
- <row >
274
- <entry ><constant >INI_USER</constant ></entry >
275
- <entry >
276
- 可在用户脚本(例如 <function >ini_set</function >)或
277
- <link linkend =" configuration.changes.windows" >Windows 注册表</link >以及 &user-ini; 中设定
278
- </entry >
279
- </row >
280
- <row >
281
- <entry ><constant >INI_PERDIR</constant ></entry >
282
- <entry >可在 &php.ini; ,&htaccess; 或 &httpd.conf; 中设定</entry >
283
- </row >
284
- <row >
285
- <entry ><constant >INI_SYSTEM</constant ></entry >
286
- <entry >可在 &php.ini; 或 &httpd.conf; 中设定</entry >
287
- </row >
288
- <row >
289
- <entry ><constant >INI_ALL</constant ></entry >
290
- <entry >可在任何地方设定</entry >
291
- </row >
292
- </tbody >
293
- </tgroup >
260
+ <xi : include xpointer =" xmlns(db=http://docbook.org/ns/docbook) xpointer(id('constant.ini-mode')/*)" ><xi : fallback /></xi : include >
294
261
</table >
295
262
</para >
296
263
</sect1 >
297
-
298
-
299
-
264
+
300
265
<sect1 xml : id =" configuration.changes" >
301
266
<title >怎样修改配置设定</title >
302
-
267
+
303
268
<sect2 xml : id =" configuration.changes.apache" >
304
269
<title >PHP 运行于 Apache 模块方式</title >
305
270
<simpara >
@@ -308,15 +273,15 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
308
273
文件中的指令来修改 PHP 的配置设定。需要有“AllowOverride
309
274
Options”或“AllowOverride All”权限才可以。
310
275
</simpara >
311
-
276
+
312
277
<para >
313
278
有几个 Apache 指令可以使用户在 Apache
314
279
配置文件内部修改 PHP 的配置。哪些指令属于
315
- <constant >INI_ALL</constant >, <constant >INI_PERDIR</constant >
280
+ <constant >INI_ALL</constant >、 <constant >INI_PERDIR</constant >
316
281
或 <constant >INI_SYSTEM</constant > 中的哪一个,请参考附录中的
317
282
<link linkend =" ini.list" >php.ini 配置选项列表</link >。
318
283
</para >
319
-
284
+
320
285
<para >
321
286
<variablelist >
322
287
<varlistentry >
@@ -414,8 +379,6 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
414
379
</para >
415
380
</caution >
416
381
</sect2 >
417
-
418
-
419
382
420
383
<sect2 xml : id =" configuration.changes.windows" >
421
384
<title >通过 Windows 注册表修改 PHP 配置</title >
@@ -433,11 +396,6 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
433
396
的值就不行。因为这些配置对于每次请求来说是只读的。
434
397
</simpara >
435
398
</sect2 >
436
-
437
-
438
-
439
-
440
-
441
399
442
400
<sect2 xml : id =" configuration.changes.other" >
443
401
<title >其它接口下的 PHP</title >
@@ -454,8 +412,6 @@ $ PHP_INI_SCAN_DIR=/usr/local/etc/php.d: php
454
412
</para >
455
413
</sect2 >
456
414
</sect1 >
457
-
458
-
459
415
460
416
</chapter >
461
417
0 commit comments