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

How to set page timeout in php

墨辰丷
墨辰丷Original
2018-06-07 11:17:351980browse

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!

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