在项目开发中,遇见layui表格出现"数据接口请求异常:parse error"错误。
php内存溢出:Allowed memory size of 1342bytes exhausted (tried to allocate 8192 bytes)本地配置和宝塔配置解决方案_数据导出

问题排查

  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 脚本内存限制

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