论坛风格切换
  • 1092阅读
  • 0回复

php导出数据过多Allowed memory size of 2147483648 bytes exhausted (tried to allocate 32 bytes) [复制链接]

上一主题 下一主题
离线hduxg
 

发帖
23
金币
107
威望
20
只看楼主 倒序阅读 使用道具 楼主  发表于: 2022-12-19
关键词: Array
php报错是这样的:
  1. PHP Fatal error:  Allowed memory size of 2147483648 bytes exhausted (tried to allocate 67108864 bytes)


php中memory_limit调大,比如40960M

或者在程序中加上

  1. set_time_limit(0); //设置脚本最大执行时间为0永不过期
  2. ini_set('memory_limit', '-1'); //Fatal error: Allowed memory size of 2147483648 bytes exhausted
  3. ini_set('display_errors', 'on');
  4. //error_reporting(E_ALL); //不展示报错信息


nginz报错是这样的:
  1. 2022/12/19 15:42:30 [error] 126627#0: *199459193 upstream timed out (110: Connection timed out) while reading response header from upstream


修改nginx超时时间
  1. keepalive_timeout 3000;
  2. fastcgi_connect_timeout 300;
  3. fastcgi_read_timeout 300;
  4. fastcgi_send_timeout 300;

再重启nginx服务

mysql可能会报一个错误,原因是一个超长的SQL执行完后,再执行其他SQL,那么mysql会超时

  1. PDO::prepare(): MySQL server has gone away


修改mysql超时时间
  1. wait_timeout = 3000




快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
提到某人:
选择好友
上一个 下一个