Question

Let's assume max_execution_time is set to 30 seconds.

Let's assume there is a script, long.php, that takes a very long time to execute (more than 30 seconds).

Let's aslo that long.php contains this line of code: ini_set('max_execution_time', 60); and let's further assume that the aforementioned line of code gets executed after 20 seconds of starting long.php.

Now my question is, does the above line of code make max execution time 60 seconds (max time since the start of the script) or 80 seconds (20 seconds from the start, then calculated max_execution_time since the change)?

Thanks.

Was it helpful?

Solution

I am not sure about using ini_set, but set_time_limit will reset the counter, so you'll end up with 80s.

When called, set_time_limit() restarts the timeout counter from zero.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top