The way to cancel the execution time limit in php is to add the code [set_time_limit(0);] directly at the beginning of the php code. We can also achieve this through the ini_set function, such as [ini_set("max_execution_time", "0");].
The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.
We can cancel the script execution time limit through the following three methods:
It can be set in php.ini
max_execution_time = 0;
It can also be set through PHP's ini_set function
ini_set("max_execution_time", "0");
You can also set it through the set_time_limit function
set_time_limit(0);
After the above settings, the script will continue to execute until the end of execution.
So, for scripts that need to be executed for a long time, generally just add the following code at the beginning of the php code
set_time_limit(0);
Free learning video sharing:Introduction to programming
The above is the detailed content of How to cancel execution time limit in php. For more information, please follow other related articles on the PHP Chinese website!