关于使用的ini_set('的max_execution_time',0); [英] On using ini_set('max_execution_time', 0);

查看:2679
本文介绍了关于使用的ini_set('的max_execution_time',0);的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用的ini_set('的max_execution_time',0);

问题1:我把它在PHP文件的顶部或在需要很长的时间做一些功能

Question 1: Do I place it at the top of the .PHP file or in a function that takes a long time to do something?

问题2:这是否设定最后被设置后,永远不会消失?或者它返回到原来的300秒或任何默认值的功能停止运行后?

Question 2: Does this setting last forever after being set? Or does it return back to its original 300sec or whatever default value after the function stops running?

推荐答案

您可以在任何地方放置它,但直到它运行的设置才会生效。所以,如果你把它的顶部,那么脚本将永远不会超时。如果你把它向下跌破上能需要一段时间的功能,那么你可能会得到上面如果脚本需要很长的时间去,你把它叫做一个暂停。

You can place it anywhere, but that setting won't take effect until it runs. So if you put it at the top, then the script will never timeout. If you put it down below on the function that can take awhile, then you may get a timeout above if the script takes a long time to get to where you called it.

当您使用的ini_set()该选项停留在为脚本的整个执行效果。

When you use ini_set() that option stays in effect for the entire execution of the script.

这篇关于关于使用的ini_set('的max_execution_time',0);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆