Increase execution time in PHP

Published on August 23rd, 2020

Ever process a file that's larger than 2GB and got an error that said something like this:

Maximum execution time of 30 seconds exceeded

Though, PHP doesn't have an efficient way of processing files of large sizes, you can prevent your web application from timing out by adding this to your code:

// 300 seconds == 5 minutes
ini_set('max_execution_time', 300);

Hopefully, some day, this might come in handy for you! 😜