How to cancel execution time limit in php

王林
Release: 2023-03-09 15:46:02
Original
2392 people have browsed it

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

It can also be set through PHP's ini_set function

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

You can also set it through the set_time_limit function

set_time_limit(0);
Copy after login
Copy after login

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

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!

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!