Home >Backend Development >PHP Tutorial >http://www.12306.cn/mormhweb/k php solution to database update interruption

http://www.12306.cn/mormhweb/k php solution to database update interruption

WBOY
WBOYOriginal
2016-07-29 08:40:02835browse

This can be solved:
set_time_limit(900);
This function specifies the maximum execution time of the current php script.
Although the setting value is 900 seconds, in fact
maximum execution time = max_execution_time value in php.ini - current script Execution time + setting value
If max_execution_time in php.ini = 30 and the current script has been executed for 10 seconds, then:
Maximum execution time = 30-10 + 900 = 920 seconds.
After such modification, the PHP script successfully updated 200,000 records.
The above was passed in the LAPP environment.
In addition, it is said that this method is not valid in the windows environment. In the windows environment, you need to specify the max_execution_time value in php.ini.
Have not tested this situation.

The above introduces the solution to http://www.12306.cn/mormhweb/k php update database interruption, including the content of http://www.12306.cn/mormhweb/k. I hope you are interested in the PHP tutorial. Friends help.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn