You can use also use the predefined PHP_SAPI constant instead of php_sapi_name().
![]() | 章 9. 运行时配置配置文件配置文件(PHP 3 中是 php3.ini,自 PHP 4 起是 php.ini)在 PHP 启动时被读取。对于服务器模块版本的 PHP,仅在 web 服务器启动时读取一次。对于 CGI 和 CLI 版本,每次调用都会读取。 php.ini 的搜索路径如下(按顺序):
如果存在 php-SAPI.ini(SAPI 是当前所用的 SAPI 名称,因此实际文件名为 php-cli.ini 或 php-apache.ini 等),则会用它替代 php.ini。SAPI 的名称可以用 php_sapi_name() 来测定。
由扩展库处理的 php.ini 指令,其文档分别在各扩展库的页面。内核配置选项见附录。不过也许不是所有的 PHP 指令都在手册中有文档说明。要得到自己的 PHP 版本中的配置指令完整列表,请阅读 php.ini 文件,其中都有注释。此外,也许从 CVS 得到的最新版 php.ini 也有帮助。
自 PHP 5.1.0 起,有可能在 .ini 文件内引用已存在的 .ini 变量。例如:open_basedir = ${open_basedir} ":/new/dir"。 ![]()
Trevor Blackbird > yurab.com
11-Apr-2006 06:50
You can use also use the predefined PHP_SAPI constant instead of php_sapi_name().
c dot affolter at stepping-stone dot ch
13-Mar-2006 09:38
For those people who want to use the PHPRC environment variable:
randy AT rcs-comp DOT com
27-May-2005 03:47
(copied from another page)
Jorrit Schippers
26-May-2004 07:33
For IIS users: If you experience high parsetimes, try to set output_buffering to On. IIS has problems with scripts outputting many small pieces of text, and with output_buffering = On, PHP sends the whole page to IIS in one piece.
| ![]() |