Is it possible to extend the execution time of a php script?

Forums PHPIs it possible to extend the execution time of a php script?
Staff asked 2 years ago

Answers (1)

Add Answer
Mitali Kukadiya Marked As Accepted
Staff answered 2 years ago

Yes, It’s possible to extend a PHP script execution time.

Set max_execution_time globally in php.ini

Open the php.ini file and change the max_execution_time value to the desired duration (in seconds).

max_execution_time=120 //120 seconds = 2 minutes

Increase the execution time of the PHP script.

ini_set( ‘max_execution_time’, ‘300’ ); //300 seconds = 5 minute

To make the execution infinite try the following code:

ini_set(  ‘max_execution_time’,  ‘0 ‘ );   //0 = NOLIMIT

Subscribe

Select Categories