PHP's Ini_set function is the value in the SET option, which takes effect after executing the function, and this setting fails at the end of the script. Not all options can be changed by the function set. The specific values can be set and the list in the manual can be viewed.
is the ability to set the option values in the php.ini for example, the Display_error option is off, but you want to display the error message in the program, so that you can debug the program, then use the PHP ini_set function:
Ini_set ("Display_errors", "on");
Then the program on your page will display an error message, and you can also use error_reporting to set the level of error messages displayed.
If you need to increase the script execution time, you can set:
Ini_set ("Max_execution_time", "180");
Then the script execution time is changed from the default of 30 seconds to 180 seconds, of course, you can also use Set_time_limit () to set.
In fact, you put PHP ini_set function and ini_get combination so that, very good. For example, if you want to add your own file path to the config file, but you have no permission to change php.ini, you can combine two functions:
Ini_set (' include_path ', ini_get (' include_path '). ':/your_include_dir: ');
PHP sets display error message and execution time via Ini_set ()