The ini_set function is the value in the setting option. It takes effect after the function is executed and expires when the script ends. Not all options can be changed to function settings. You can set specific values to view the list in the manual.You can set the option value in php. ini. For example, if the display_error option is disabled, but you want to display the error information in the program so that you can debug the program, you can use the PHP ini_set function:
- Ini_set ("display_errors
"," On ");
The program on your page will display the error information, and you can also use error_reporting to set the displayed error information level.
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 30 seconds to 180 seconds by default. Of course, you can also set it using set_time_limit.
In fact, if you combine the PHP ini_set function with ini_get, it is very good. For example, if you want to add your own include file path in the configuration file, but you have the permission to change php. ini, you can combine the following two functions:
- Ini_set ('include _ Path'
, Ini_get ('include _ path ').
':/Your_include_dir :');