Fatal error: Allowed memory size of 8388608 bytes exhausted

PHP has a built-in limit on the amount of memory it will allocate. If that limit is reached, the process will exit with this error message. This is usually the result of the PHP script trying to load a large file, such as an image, into memory all at once. While it is better if you can arrange for the script not to do such things, it is also possible to increase the memory limit some to avoid this problem. To do that, edit the php.ini file (create it if it does not exist in your web root folder, normally public_html/) and add the following line:


You should replace the ’16’ with whatever value is appropriate. The default is 8M (8 megabytes, the 8388608 bytes from the error message).

You can also change the value of this PHP directive in run-time by means of the ini_set() function. To read more about the ini_set() function check the official documentation here.