Home  >  Article  >  php教程  >  php设置页面超时时间解决方法

php设置页面超时时间解决方法

WBOY
WBOYOriginal
2016-06-06 19:44:16999browse

大家都遇到过由于网络卡导致的网页一直在转吧,看到此现象我想是不是可以给网页设置一个超时时间,设置一个时间多久没反应就提示超时信息呢?下面看看小编是怎么

有时候我的页面因为网络卡,,会一直转,我想是不是可以给页面设置一个超时时间,多久没反应就提示超时

比如php里的set_time_limit(300)

我想不是php页面也有个超时机制

------解决思路----------------------

php 里不就是set_time_limit() 吗,你还可以设置php.ini中的max_execution_time来改变全局超时时间。

------解决思路----------------------

max_execution_time

------解决思路----------------------

set_time_limit(300)

卡5分钟了,有点大。除非你执行的是很大量的程序。

------解决思路----------------------

ini_set('max_execution_time', '0'),数值 0 表示没有执行时间的限制。

建议不要超过30秒。

以上内容很简短吧,轻松解决了php设置页面超时时间,希望本篇文章对大家有所帮助。

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