How to change php.ini file settings in laravel | what is use of ini_set

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);
php laravel developer anmol sharma

Anmol Sharma

I am a software engineer and have experience in web development technologies like php, Laravel, Codeigniter, javascript, jquery, bootstrap and I like to share my deep knowledge by these blogs.

Random tutorial links