Home >Backend Development >PHP Problem >How to set the php page timeout

How to set the php page timeout

藏色散人
藏色散人Original
2021-06-27 13:49:543541browse

How to set the php page timeout: first find and open the php.ini file; then set max_execution_time in php.ini to change the global timeout.

How to set the php page timeout

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How to set the php page timeout?

php setting page timeout solution

Everyone has encountered that the web page has been redirected due to network card. Seeing this phenomenon, I thought Is it possible to set a timeout period for the web page and prompt a timeout message after a certain amount of time if there is no response?

Sometimes my page will keep redirecting due to network card. I wonder if I can set a timeout for the page. If there is no response for a long time, it will prompt a timeout.

For example set_time_limit(300) in php

I don’t think the php page also has a timeout mechanism

------Solution Idea-------------- --------

Isn't it set_time_limit() in php? You can also set max_execution_time in php.ini to change the global timeout.

------Solution Idea----------------------

max_execution_time

- -----Solution idea----------------------

set_time_limit(300)

It has been stuck for 5 minutes. a bit big. Unless you are executing a large number of programs.

------Solution Idea----------------------

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

It is recommended not to exceed 30 seconds.

Recommended learning: "PHP Video Tutorial"

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