CakeFest 2024: The Official CakePHP Conference

配置可被设定范围

这些模式决定着一个 PHP 的指令在何时何地,是否能够被设定。手册中的每个指令都有其所属的模式。例如有些指令可以在 PHP 脚本中用 ini_set() 来设定,而有些则只能在 php.inihttpd.conf 中。

例如 output_buffering 指令是属于 INI_PERDIR,因而就不能用 ini_set() 来设定。但是 display_errors 指令是属于 INI_ALL 因而就可以在任何地方被设定,包括 ini_set()

INI 模式常量
常量 说明
INI_USER (int) 可以在用户脚本(如使用 ini_set())或 Windows 注册表中设置条目。可以在 .user.ini 中设置条目
INI_PERDIR (int) 可以在 php.ini.htaccesshttpd.conf.user.ini 中设置条目
INI_SYSTEM (int) 可以在 php.inihttpd.conf 中设置条目
INI_ALL (int) 条目可以设置在任何地方

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top