There is a simple method, which is to modify the configuration file directly in the script:
As follows:
------------------ -------------------------------------------------- -------------------
//Modify the maximum execution time
ini_set("max_execution_time", 2400); // s 40 minutes
//Modify the maximum running memory this time
ini_set("memory_limit", 1048576000); // Byte 1000 MB, which is 1G
---------- -------------------------------------------------- --------------------------
The modified parameters will only take effect when running the script this time!