Jump to:

23491 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Fatal Error: Allowed Memory Size - How to Find/Remove offending image

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

Page: 1
Go to End
Author Topic: 411 Views
  • Futureweb
    Avatar
    Community Member
    232 Posts

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

    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

  • zlincoln
    Avatar
    Community Member
    3 Posts

    Re: Fatal Error: Allowed Memory Size - How to Find/Remove offending image Link to this post

    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

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: Fatal Error: Allowed Memory Size - How to Find/Remove offending image Link to this post

    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)

    411 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.