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

Posted 2019ab

tags:

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

php报错

原因:超出了PHP最大内存。

处理办法

1.在文件中添加

@ini_set('memory_limit', '512M'); // 设置最大内存

2.修改php.ini文件

打开终端输入下列bash命令

cd /private/etc
sudo cp php.ini.default php.ini
sudo vi php.ini
memory_limit = 128 #这里按照业务需求修改大小

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

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 1099 bytes) in

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

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