The ini_set() function is used to set PHP configuration options at runtime.
ini_set
is a PHP function that allows developers to set a configuration option at runtime. This is done by calling the function in any PHP script with the option name ($varname
) and the value ($newvalue
) to be set:
ini_set ( string $varname , string $newvalue ) : string
If the execution is successful the function returns the previously set value, otherwise it returns false. At the end of the script execution the previous value will be restored automatically.
The option name must contain a valid configuration option name. A full list of names including their default values can be found in the List of php.ini directives in the PHP Manual. Only options with the modes PHP_INI_USER
or PHP_INI_ALL
can be changed with ini_set()
. All other options require to be changed by editing php.ini.