If you ever encountered an error message in Laravel similar to maximum execution time of 60 seconds exceeded
or maximum execution time of 30 seconds exceeded
.
The message indicates that the request you are currently making it taking too much time for the server to respond. To fix this issue, there are two options.
One is to investigate the call that you are making and optimize it, so the response can be as fast as possible.
The other option is to increase the limit from the php.ini
file, but you need to be cautious. Make sure this is really what you want to do. Because if you do not optimize the code, the response might increase linearly as your dataset grows.
To update the execution time in php.ini
, find the parameter max_execution_time
:
ini_set('max_execution_time', 180); //3 minutes