Allowed memory size bytes exhausted
I receive the following error message:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 7544 bytes)
Answer:It looks like you are trying to process too big images and you have exceed PHP memory limit. Usually. PHP is configured to consume maximum 8 MB of memory per PHP page, which your case is not enough. To fix it you have to increase the memory limit.
You can do that by:
* Adding the following line at the top of the file cImageEditor.php (By default it is situated into ScriptLibrary\lib folder):
ini_set("memory_limit","16M");
OR
* Set the following variable into Resource Limits section of your php.ini:
memory_limit = 16M
Note: Changing php.ini file will affect the memory limits of all your php application. Therefore, it is not recommended solution (It is added only for completeness).
OR
* You could use the this solution when you do not have access to php.ini file or do not want to manually change php.ini or cImageEditor.php files.
To implement it you have to add the following line to your .htaccess file:
php_value memory_limit 16M
The above solution set memory limit of 16M. If 16M is not enough, you can further increase the memory limit (For example to 32M)
Comments
Be the first to write a comment
You must me logged in to write a comment.