Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Fatal Error: Allowed Memory Size - How to Find/Remove offending image


Reply


3 Posts   480 Views

Avatar
Futureweb

Community Member, 233 Posts

12 February 2013 at 10:05am

It's happened to me numerous times when clients have uploaded images that are too big for GD on their server to handle.

The result is 'Fatal Error: Allowed Memory Size' errors on the screen, and the CMS page becomes unusable where that image is attached.

This usually means I have to go and search on the server for large images, download, make it smaller, upload agian, and it's all ok, but it's a real pain...

I'm wondering if anyone can help me out, what I'm hoping for is:

1: a quick way of knowing which particular image cuased this error - eg, getting a better error message back from 'sapphire/filesystem/GD.php'

2: some way Silverstripe sees the error, and instead of just failing completely, it allows the user to remove the image, and try again

I'm working here with SS 2.4, but i think it's the same issue in 3

Cheers

Avatar
zlincoln

Community Member, 3 Posts

12 February 2013 at 11:00am

Quoting Uncle Cheese:

_config.php

ini_set('memory_limit','256M');

.htaccess

php_value memory_limit 256M

http://www.silverstripe.org/all-other-modules/show/10518

Avatar
Futureweb

Community Member, 233 Posts

12 February 2013 at 11:08am

Hi, yup, that's a way of trying to avoid the problem, but i've found clients will still end up trying to upload a 15mb, 6000 pixel wide image and screw things up!

putting an upload limit is another option, but with jpgs its more to do with the pixel size than file size when it comes to resizing it, and some hosting companies don't allow you to up the memory limit (which is the case in the site i'm working on just now)