简体   繁体   中英

max_execution_time in PHP

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM