您当前的位置: 首页 >  php

漏刻有时

暂无认证

  • 0浏览

    0关注

    717博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

php内存溢出:Allowed memory size of 1342bytes exhausted (tried to allocate 8192 bytes)本地配置和宝塔配置解决方案

漏刻有时 发布时间:2020-09-02 17:58:04 ,浏览量:0

在项目开发中,遇见layui表格出现"数据接口请求异常:parse error"错误。 在这里插入图片描述

问题排查
  1. layui table 接口错误,说明ajax获取数据API出错,直接访问api地址;
  2. ajax访问api页面出现如下提示:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /www/conf/lockdata.mysql.php on line 113
原因分析

出现该错误,倒是意料之中的,因项目需求,需要将数据表的全部数据导出,瞬间访问量和读取量增加,导致内存溢出。

解决方案

php.ini配置方案

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit

宝塔配置解决方案

memory_limit 256M 脚本内存限制

在这里插入图片描述 Done!

关注
打赏
1661217259
查看更多评论
立即登录/注册

微信扫码登录

0.1682s