加入收藏 | 设为首页 | 会员中心 | 我要投稿 北几岛 (https://www.beijidao.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – 使用ini_set(“memory_limit”,“ – 1”)并且仍然没有

发布时间:2021-07-06 05:22:32 所属栏目:大数据 来源: https://www.jb51.cc
导读:我正在处理一个旧的数据库PHP数组到一个新的数据库.数据.PHP文件总共大约220 MB. 我在脚本中插入了这些行,以便它可以正常运行: ini_set("memory_limit", "-1");set_time_limit(0); 这就是我包含产品的方式: // The exports made by PHPMYADMIN, exported a

我正在处理一个旧的数据库PHP数组到一个新的数据库.数据.PHP文件总共大约220 MB.

我在脚本中插入了这些行,以便它可以正常运行:

ini_set("memory_limit", "-1");
set_time_limit(0);

这就是我包含产品的方式:

// The exports made by PHPMYADMIN, exported as PHP-Array
require_once 'export/tx_ttproductsv2_products.PHP';
require_once 'export/tx_ttproductsv2_keyword.PHP';
require_once 'export/tx_ttproductsv2_keywords_in_products.PHP';
require_once 'export/tx_ttproductsv2_typebook.PHP';
require_once 'export/tx_ttproductsv2_typegospel7.PHP';
require_once 'export/tx_ttproductsv2_typemedia.PHP';

当脚本试图要求它们时,我收到此错误:

PHP Fatal error: Out of memory (allocated 880541696) (tried to allocate 469762048 bytes) in ……

我在x64 Win 7 SP1上运行了本地EasyPHP安装.我有6 GB的内存,Intel i5.

如何在没有内存错误的情况下让PHP运行整个脚本?

解决方法:

内存限制来自操作系统,而不是来自PHP本身.

您的脚本分配了800MB,并且正在尝试进一步分配500MB

尝试使用64位PHP在64位操作系统上运行该脚本.

(编辑:北几岛)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读