php的Allowed memory size of 134217728 bytes exhausted问题

Posted 流光瞬息

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php的Allowed memory size of 134217728 bytes exhausted问题相关的知识,希望对你有一定的参考价值。

提示Allowed memory size of 134217728 bytes exhausted,出现这种错误的情况常见的有三种:

0:查询的数据量大。

1:数据量不大,但是php.ini配置的内存太小。

2:逻辑出现死循环。

解析:

134217728/1024/1024 = 128M

解决方案:

0:修改php.ini

memory_limit = 128

但是这种需要重启服务器,所以对于虚拟机有限制

1:通过ini_set函数修改配置选项值

// 升级256M、128M内存
ini_set(‘memory_limit‘,‘256M‘)
ini_set(‘memory_limit‘,‘128M‘)
// 不做限制
ini_set(‘memory_limit‘,‘-1‘)

  

 

以上是关于php的Allowed memory size of 134217728 bytes exhausted问题的主要内容,如果未能解决你的问题,请参考以下文章

php的Allowed memory size of 134217728 bytes exhausted问题

php遇到Allowed memory size of 134217728 bytes exhausted问题解决方法

执行php程序的时候,报错Allowed memory size of 134217728 bytes exhausted (tried to allocate 83 bytes)

PHP的内存限制 Allowed memory size of 134217728 bytes exhausted (tried to allocate 1099 bytes) in

Allowed memory size of 134217728 bytes exhausted (tried to allocate 39845912 bytes)

Allowed memory size of 134217728 bytes exhausted