ini_set,set_time_limit,(max_execution_time) - 不工作 [英] ini_set, set_time_limit, (max_execution_time) - not working

查看:133
本文介绍了ini_set,set_time_limit,(max_execution_time) - 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我做 set_time_limit(50) ini_set('max_execution_time',50) ini_get('max_execution_time')在我的localhost我得到 50 ,但是当我在另一个服务器,默认 30 ,完全忽略我的请求。为什么是这样?

If I do set_time_limit(50) or ini_set('max_execution_time',50), then when I echo ini_get('max_execution_time') on my localhost i get 50, but when I do this on another server it echoes the default 30 and completely ignores my request. Why is this?

推荐答案


不能使用
更改此设置ini_set当在安全模式下运行时。
唯一的解决方法是关闭
安全模式或通过更改php.ini中的时间
限制。

You can not change this setting with ini_set() when running in safe mode. The only workaround is to turn off safe mode or by changing the time limit in the php.ini.

- PHP手册,运行时配置, max_execution_time 描述

-- PHP manual, Runtime Configuration, description of max_execution_time

许多主机以安全模式运行。

Many hosts run in safe mode. The other server is most likely one of them.

编辑: set_time_limit 上也有相同的限制:

The same restriction is in place on set_time_limit:


当PHP
在安全模式下运行时,此函数无效。除了关闭安全
模式或更改
php.ini中的时间限制之外,没有
的解决方法。

This function has no effect when PHP is running in safe mode. There is no workaround other than turning off safe mode or changing the time limit in the php.ini.

- PHP手册, set_time_limit page

-- PHP manual, set_time_limit page

这篇关于ini_set,set_time_limit,(max_execution_time) - 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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