Home  >  Article  >  Backend Development  >  How to cancel execution time limit in php

How to cancel execution time limit in php

王林
王林Original
2021-05-11 16:11:442501browse

The way to cancel the execution time limit in php is to add the code [set_time_limit(0);] directly at the beginning of the php code. We can also achieve this through the ini_set function, such as [ini_set("max_execution_time", "0");].

How to cancel execution time limit in php

The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.

We can cancel the script execution time limit through the following three methods:

It can be set in php.ini

max_execution_time = 0;

It can also be set through PHP's ini_set function

ini_set("max_execution_time", "0");

You can also set it through the set_time_limit function

set_time_limit(0);

After the above settings, the script will continue to execute until the end of execution.

So, for scripts that need to be executed for a long time, generally just add the following code at the beginning of the php code

set_time_limit(0);

Free learning video sharing:Introduction to programming

The above is the detailed content of How to cancel execution time limit 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