Setting method: 1. In php.ini, find and set the value of the "max_execution_time" item; 2. Set through the "ini_set("max_execution_time","value");" statement; 3. Through "set_time_limit (numeric value)" statement setting.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
php method to set script execution time
1. Set in php.ini
max_execution_time = 120;
2. Set through PHP’s ini_set function
ini_set("max_execution_time", "120");
3. Set through set_time_limit function
set_time_limit(120);
If the above numbers are set to 0, there is no limit, and the script will continue to execute until the execution is completed.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to set script execution time in php. For more information, please follow other related articles on the PHP Chinese website!