Friday 21 March 2014

How to Increase PHP Memory Limit


How to Increase PHP Memory Limit When you saw an error like “Fatal Error: Allowed memory size of xxxxxx bytes exhausted” either in browser or server logs, it means PHP had exhausted the max memory limit. Mostly, this is due to the insufficient memory allocated for PHP script. And in this article, we will talk about how to increase the memory limit of PHP.
Check PHP memory_limit
To see how much memory allocated for you php, you need to create a file on your server (like view_php_info.php), and put following code in it:
<?php phpinfo();?>
Visit it in your browser, you’ll see a table which lists out all the config about current php environment. Search for “memory_limit”, you’ll see: