允许在base64_encode上耗尽的字节大小

时间:2014-04-01 14:07:28

标签: php serialization encoding

我得到一个"允许的字节大小的字节耗尽"当我尝试base64_encode一个序列化数组(它很长)。有没有推荐的方法来解决这个问题呢?

$_SESSION['stats'] = base64_encode(serialize($stats));

编辑:这是实际错误

Allowed memory size of 262144000 bytes exhausted (tried to allocate 34029660 bytes)

1 个答案:

答案 0 :(得分:0)

在php脚本的启动时使用此设置。此设置将允许php超过每个php脚本允许使用的最大内存量。

<?php
ini_set("memory_limit", "-1");

//Your remaining code..

?>

其他链接 https://drupal.org/node/207036