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

码农天地 -
Allowed memory size of 134217728 bytes exhausted (tried to allocate 23072768 bytes)

PHP异常报错,错误如下:

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

这种错误说明php代码能够申请到的最大内存字节数就是134217728 bytes,如果代码执行的时候再需要更多的内存,就会报错了。解决方法就是增加PHP能够使用的最大内存。

在php.ini中找到:memory_limit = 128M

把这里的128M更改为更大的值,例如:改为256M,改完记得重启下web服务器,使其生效。

Tags 标签

php异常php报错PHP内存

扩展阅读

加个好友,技术交流

1628738909466805.jpg