php - 如何解决 OpenCart 中的内存分配错误?
问题描述
OpenCart 中出现以下错误:
Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 8192 bytes)
文件:\system\storage\vendor\twig\twig\lib\Twig\Extension\Core.php 第 149 行
我不明白这是什么意思,因为分配的内存小于允许的大小。我该如何解决?
解决方案
从 opencart 文件夹编辑 php.ini 文件并增加“memory_limit”的大小,直到错误消失
memory_limit = 128M;
或者
编辑“config.php”和“admin/config.php”在最后添加以下代码
ini_set('memory_limit', '128M');
推荐阅读
- reactjs - 如何从 fullcalendar 的 eventClick 中访问 JSX 函数
- excel - 使用MATLAB通过ActiveX协议将String值写入Excel电子表格..发现问题
- reactjs - 单击按钮时如何修复 onSubmit 函数不显示状态?
- c# - 如何在c#中将数字转换为十进制格式的值?
- java - 如何使用 Jsoup 读取 h3 和之后的文本元素?
- python - 查找作为列表存在的列元素的数据框索引的最快方法
- keras - 当我想计算灵敏度和特异性时,Keras 中的错误
- unity3d - 3d 物体位置跳跃运动
- excel - 无法使用年龄和性别正确输入 AVERAGEIF
- python - 存在于位置时未找到 Raspberry Pi 文件