How to set the page not to timeout in php

王林
Release: 2023-03-10 21:34:02
Original
3411 people have browsed it

The method for php to set the page not to time out is to set max_execution_time in the php.ini configuration file to change the global timeout, such as [max_execution_time set_time_limit(300)].

How to set the page not to timeout in php

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

Sometimes our page may keep loading due to network reasons, so we can consider setting a timeout for the page. Once this timeout expires and there is no response, a timeout will be prompted.

For example, set_time_limit(300) in php. I don’t think the php page also has a timeout mechanism. Isn’t it just set_time_limit() in php? You can also set max_execution_time in php.ini to change the global timeout.

max_execution_time
set_time_limit(300)
Copy after login

The card has been stuck for 5 minutes, which is a bit big. Unless you are executing a large number of programs.

ini_set('max_execution_time', '0'), a value of 0 means there is no execution time limit.

Note: It is recommended not to exceed 30 seconds.

Related learning video sharing: php video tutorial

The above is the detailed content of How to set the page not to timeout 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