How to increase maximum execution time in php

Pritesh Mahajan picture Pritesh Mahajan · Apr 23, 2013 · Viewed 538.4k times · Source

I want to increase maximum execution time in php , not by changing php.ini file.

I want to Increase it from my php file.

Is this possible?

Answer

James Scholes picture James Scholes · Apr 23, 2013
ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
ini_set('max_execution_time', '0'); // for infinite time of execution 

Place this at the top of your PHP script and let your script loose!

Taken from Increase PHP Script Execution Time Limit Using ini_set()