user966834
user966834

Reputation: 85

Magento Fatal Error due to memory allocated for images

Im getting the following error after uploading an image for a product (the other 10 uploaded are fine).

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 9600001 bytes) in /home/site/public_html/lib/Varien/Image/Adapter/Gd2.php on line 214

I have tried increasing the php limit through .htacess and php.ini but still no joy.

Update

ok the memory is currently set to 64m (used phpinfo), i have added php_value memory_limit 512M to .htaccess in the root directory

ive also just noticed i was only changing the sample php.ini provided (php.ini.sample) changing this to php.ini simply knocks down my site so i cannot see the effects anyway

Upvotes: 0

Views: 5173

Answers (3)

user966834
user966834

Reputation: 85

The reason my php.ini file was causing problems is because the default sample provided was not loading the PDO mySql extensions which i resolved by using

extension=pdo.so
extension=pdo_mysql.so

then simply changing the memory limit in php.ini did the trick thankyou for the help

Upvotes: 0

RichardBernards
RichardBernards

Reputation: 3097

There are two ways to handle this:

  1. Use the by Ruddy proposed method for increasing the php memory_limit. This could work, but please do this in a .htaccess file (so there is no difference in this setting throughout your Magento instance).
  2. Find out which image is being processed. Magento resizes images for caching and this error usually is a result from an oversized image being loaded into the GD library. I once got this error when it tried to resize an image of 36000 by 36000 pixels (sigh...)

Upvotes: 1

Ruddy
Ruddy

Reputation: 9923

ini_set('memory_limit', '-1'); overrides the default PHP memory limit.

As Chris Lane stated in a similar post. (wouldn't recommend it)

Upvotes: 1

Related Questions