inimrepus
inimrepus

Reputation: 69

Allowed memory size of bytes exhausted on base64_encode

I am getting an "Allowed memory size of bytes exhausted" when I attempt to base64_encode a serialized array (it is long). Is there any recommended way to do this without running into this issue?

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

EDIT: Here is the actual error

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

Upvotes: 1

Views: 2371

Answers (1)

Shashidhar Gr
Shashidhar Gr

Reputation: 418

use this setting at the starting of your php script.This setting will allow php to exceed maximum amount of memory that each php script allowed to use.

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

//Your remaining code..

?>

other links https://drupal.org/node/207036

Upvotes: 1

Related Questions