Increase PHP Script Execution Time Limit

Every once in a while we need to process a HUGE file. Though PHP probably isn’t the most efficient way of processing the file, we usually use PHP because it makes coding the processing script much faster. To prevent the script from timing out, I need to increase the execution time of the specific processing script.

How to fix

<?php
     //300 seconds = 5 minutes
     ini_set('max_execution_time', 300);
?>

Place this at the top of your PHP script.

Permanent link to this article: https://blog.openshell.in/2010/11/increase-php-script-execution-time-limit/

Leave a Reply

Your email address will not be published.