Home  >  Article  >  Backend Development  >  How to set the page not to timeout in php

How to set the page not to timeout in php

王林
王林Original
2021-06-25 10:25:003353browse

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)

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!

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