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

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

问题描述

如果我执行 set_time_limit(50)ini_set('max_execution_time',50),那么当我回显 ini_get('max_execution_time')> 在我的本地主机上,我得到 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 也有同样的限制:

该函数在 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

-- PHP manual, set_time_limit page

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

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