Home >Backend Development >PHP Problem >How to set script execution time in php

How to set script execution time in php

青灯夜游
青灯夜游Original
2021-05-21 17:29:074072browse

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.

How to set script execution time in php

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!

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