downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

怎样修改配置设定> <.user.ini 文件
[edit] Last updated: Fri, 14 Jun 2013

view this page in

配置可被设定范围

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

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

PHP_INI_* 模式的定义
模式 含义
PHP_INI_USER 可在用户脚本(例如 ini_set())或 Windows 注册表(自 PHP 5.3 起)以及 .user.ini 中设定
PHP_INI_PERDIR 可在 php.ini.htaccesshttpd.conf 中设定
PHP_INI_SYSTEM 可在 php.inihttpd.conf 中设定
PHP_INI_ALL 可在任何地方设定



add a note add a note User Contributed Notes 配置可被设定范围 - [1 notes]
up
-6
mritunjay dot kumar at ballisticlearning dot com
5 months ago
There are several Apache directives that allow you to change the PHP configuration from within the Apache configuration files. For a listing of which directives are PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM.

Sets the value of the specified directive. Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a previously set value use none as the value.

A handy trick to pick up parse errors in test_file.php if you can't set display_errors in php.ini or use .htaccess:
<?php
error_reporting 
(E_ALL);
ini_set ('display_errors', true);
include(
'./test_file.php');
?>

 
show source | credits | sitemap | contact | advertising | mirror sites