In this tutorial, we will discuss what is the use of ini_set() in laravel, what parameters change by ini_set(), how to change php.ini values in laravel, how to increase execution time in laravel.
Change php.ini values in laravel by ini_set()
ini_set() method is use for change some configuration of php.ini file in current execution only. This method requires two parameters first is the name of the setting and second is value.
Is ini_set() method change values for only current execution
Yes ini_set() method change any setting for only current execution after that php using original values of php.ini.
Examples of ini_set in laravel
Enable display_errors
We can enable or disable showing errors by changing the php.ini display_errors setting. use this code in starting of the controller method.
ini_set('display_errors', '1');
Increase max execution time
We can also increase max execution time by changing max_execution_time setting in php.ini by ini_set() method in laravel.
ini_set('max_execution_time', 500);