的ini_set(QUOT; memory_limit的")在PHP 5.3.3中不工作 [英] ini_set("memory_limit") in PHP 5.3.3 is not working at all
问题描述
我以前有这个工作:
echo ini_get("memory_limit")."\n";
ini_set("memory_limit","256M");
echo ini_get("memory_limit")."\n";
这将输入这样的:
32M
256M
通过命令行执行的PHP脚本。
我从5.2升级到5.3,从现在开始,该指令是不是在所有的工作:这给了我:
on a php script executed by command line. I updated from 5.2 to 5.3, and from now, this directive is not working at all : this gives me :
32M
32M
,然后让我的脚本失败,一个致命的错误...
and then make my script fail with a fatal Error...
我查了一下PHP文档和Google搜索它,我没有发现任何地方,memory_limit的曾德precated。
I checked the php documentation, and googled it, and I didn't find anywhere that "memory_limit" had been deprecated.
有没有人有办法解决吗?
Does anyone have a solution?
推荐答案
如果您拥有了Suhosin扩展启用,它可以从设定的内存限制超越它开始还是有些规定上限prevent脚本。
If you have the suhosin extension enabled, it can prevent scripts from setting the memory limit beyond what it started with or some defined cap.
<一个href=\"http://www.hardened-php.net/suhosin/configuration.html#suhosin.memory_limit\">http://www.hardened-php.net/suhosin/configuration.html#suhosin.memory_limit
这篇关于的ini_set(QUOT; memory_limit的&QUOT;)在PHP 5.3.3中不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!