How to set page timeout in php

墨辰丷
Release: 2023-03-30 11:56:02
Original
1975 people have browsed it

This article mainly introduces the method of setting the page timeout in PHP. Interested friends can refer to it. I hope it will be helpful to everyone.

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.

Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.

Related recommendations:

PHP How to convert Chinese characters into pinyin and get the first letter of a word

##PHP Implement symmetric encryption and decryption

php determines whether the required parameters in the function exist

The above is the detailed content of How to set page timeout in php. For more information, please follow other related articles on the PHP Chinese website!

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