 <p>There times that you will use more memory than the 8 MB php has allotted. If your unable to use less memory by making your code more efficient, you might have to increase your available memory. This can be done in two ways.</p> <p>The limit can be set to a global default in php.ini:</p> <pre><code>memory_limit = 32M </code></pre> <p>Or you can override it in your script like this:</p> <pre><code>&lt;?php ini_set('memory_limit', '64M'); ... </code></pre> <p>For more on PHP memory limit you can see <a href="http://stackoverflow.com/questions/620602/php-memory-limit">This SO question</a> or <a href="http://www.php.net/manual/en/ini.core.php#ini.memory-limit" rel="nofollow">ini.memory-limit</a>.</p>