msgbartop
PHP应用,PHP源码分析,Zend引擎分析,Web相关技术研究,Web技术分享 – 左手代码 右手诗
msgbarbottom

27 Nov 09 memory_limit的一个bug

PHP 5.2x中, 由于错误的选用了zend_atoi, 导致memory_limit不能设置为超过4G的值.

今天同事分享给我一个问题(thans to yanmi), 一段代码(PHP 5.2.11 Linux/X86_64),设置memory_limit为4096M会导致内存耗尽, 而设置4095M就不会. 奇怪的问题呵.

那是怎么回事呢?