ini_set

(PHP 4 )

ini_set -- Sets the value of a configuration option

Description

string ini_set ( string varname, string newvalue)

Sets the value of the given configuration option. Returns the old value on success, FALSE on failure. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.

Not all the available options can be changed using ini_set(). Below is a table with a list of all PHP options (as of PHP 4.2.0), indicating which ones can be changed/set and at what level.

表格 1. Configuration options

"0"
"0"
"0"
"1"
""
"ISO-8859-15"
"UCS-2BE"
"UCS-2LE"
""
"JIS"
"JIS"
"1"
"0"
"1"
"-1"
"128"
"128"
"128"
"1000"
"_SYSTEM"
""
""
""
"0"
"0"
"418"
"1"
"-1"
"-1"
"1"
"0"
"0"
"0"
"0"
"1"
"-1"
"-1"
"1"
"-1"
"-1"
"%m/%d/%Y%H:%M:%S"
"%m/%d/%Y"
"%H:%M:%S"
"-1"
"0"
"/usr/share/misc/magic.mime"
"1"
"-1"
"-1"
"25"
"10"
"10"
"0"
"5"
"60"
"-1"
"-1"
"0"
"1"
"1"
"-1"
"-1"
"42"
"foobar"
"1"
"-1"
"-1"
"4096"
"1"
"1"
"test.signio.com"
"test-payflow.verisign.com"
"443"
"30"
""
""
""
""
"1"
"-1"
"-1"
"0"
"0"
"0"
"/tmp"
"PHPSESSID"
"files"
"0"
"1"
"1440"
"php"
"0"
"/"
""
""
"1"
"0"
""
""
"0"
"nocache"
"180"
"1" PHP_INI_SYSTEM|PHP_INI_PERDIR
"globals,track"
"1"
"0"
"1"
"0"
"a=href,area=href,frame=src,form=fakeentry"
"1"
"-1"
"-1"
"10"
"10"
""
"0" PHP_INI_SYSTEM|PHP_INI_PERDIR
"-1"
"0"
"1" PHP_INI_SYSTEM|PHP_INI_PERDIR
"0" PHP_INI_SYSTEM|PHP_INI_PERDIR
"1"
"0"
"1"
"1"
"1"
"0"
"0"
"0"
"0" PHP_INI_PERDIR|PHP_INI_SYSTEM
"0"
"1024"
"0"
"0"
"1" PHP_INI_PERDIR|PHP_INI_SYSTEM
"0"
"0"
"0" PHP_INI_PERDIR|PHP_INI_SYSTEM
PHP_INI_PERDIR|PHP_INI_SYSTEM
"1" PHP_INI_PERDIR|PHP_INI_SYSTEM
"0" PHP_INI_PERDIR|PHP_INI_SYSTEM
"1"
"0"
"0"
PHP_INI_SYSTEM|PHP_INI_PERDIR
"0"
"0"
"0"
PHP_INI_SYSTEM|PHP_INI_PERDIR
PHP_INI_SYSTEM|PHP_INI_PERDIR
PHP_INI_SYSTEM|PHP_INI_PERDIR
"GPC"
"30"
"1"
"2M"
"1"
"8M"
"localhost"
"8M"
"14"
""
"1"
"0"
"0"
"1"
"0"
"0"
"0"


表格 2. Definition of PHP_INI_* constants

Entry can be set in php.ini, .htaccess or httpd.conf


See also: ini_alter(), ini_get(), and ini_restore()