Rather than changing the memory_limit
value in your php.ini
file, if there's a part of your code that could use a lot of memory, you could remove the memory_limit
before that section runs, and then replace it after.
$limit = ini_get('memory_limit');
ini_set('memory_limit', -1);
// ... do heavy stuff
ini_set('memory_limit', $limit);