错误: allowed memory size of xxx bytes exhausted at xxx:xxx (tried to allocate xxx bytes)
这个报错信息的意思是是说,若ini配置的memory_limit(内存限制) 大于 AG(allocated_memory)
解决方法如下:
第一种方法:修改 php.ini配置文件,在php.ini中找到代码,代码如下:
; Maximum amount of memory a script may consume (128MB) ; http://php.net/memory-limit memory_limit = 8M
将前面的分号去掉,改动值的大小,将memory_limit由8M改成16M(或更大),如下,然后重启apache服务即可
立即学习“PHP免费学习笔记(深入)”;
Maximum amount of memory a script may consume (128MB) http://php.net/memory-limit memory_limit = 256M
第二种方法:在PHP文件中加入如下代码:
ini_set(”memory_limit”,”80M”);//大小根据自己的情况改动
以上就是php运行出现Allowed memory size of ,该如何解决?的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号