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

How to set script execution time in php

青灯夜游
Release: 2023-03-09 20:48:02
Original
4076 people have browsed it

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;
Copy after login

2. Set through PHP’s ini_set function

ini_set("max_execution_time", "120");
Copy after login

3. Set through set_time_limit function

set_time_limit(120);
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template