Home >Backend Development >PHP Tutorial >How to set page timeout in php
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!