Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » How to Change Memory Limit for Fatal error: Allowed memory size

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: 3167 Views
  • xcommum
    Avatar
    Community Member
    10 Posts

    How to Change Memory Limit for Fatal error: Allowed memory size Link to this post

    I am having problems uploading a 1MB file of contacts (CSV) to a newsletter mailing list, however I always get an error during upload, error is: Fatal error: Allowed memory size of x bytes exhausted (tried to allocate 49 bytes) in /cms/code/Newsletter/RecipientImportField.php on line 151

    I tried adding 'ini_set('memory_limit', '64M');' to /sapphire/main.php but this did not help. Any ideas??

  • Double-A-Ron
    Avatar
    Community Member
    603 Posts

    Re: How to Change Memory Limit for Fatal error: Allowed memory size Link to this post

    Wierd error for a 1MB file, but try setting the memory limit in .htaccess instead:

    php_value memory_limit 64M

  • xcommum
    Avatar
    Community Member
    10 Posts

    Re: How to Change Memory Limit for Fatal error: Allowed memory size Link to this post

    Thanks for the tip, tried that as well, but with no luck.. I had to use another newsletter system instead to be able to handle the contact load list. Other systems seem to have no trouble with it.. (ie. PHPlist)

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: How to Change Memory Limit for Fatal error: Allowed memory size Link to this post

    I have a similar same issue. Client uploaded 3 large images (around 2MB each) in the 'Uploads' folder by using the 'Files & Images' tab. When clicking the 'edit' icon behind these images in the 'Files & Images' section OR when selecting the 'Uploads' folder when adding image to TinyMCE HTMLEditorField the following error message occurs:
    <br >
    <br >Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 26000 bytes) in /home/domains/mywebsite.com/public_html/sapphire/filesystem/GD.php on line 24
    <br >
    <br >Adding 'php_value memory_limit 64M' to .htaccess file (or even 'php_value memory_limit 128M') did not change anything. phpinfo() tells me the memory limit is 128M.
    <br >
    <br >Please help, many thanks in advance.

  • klikhier
    Avatar
    Community Member
    150 Posts

    Re: How to Change Memory Limit for Fatal error: Allowed memory size Link to this post

    After some more investigation this is not related to file size, but to file dimensions (in this case the abnormal 6500px width). Is there something we can do to either resize the image after upload in the 'Files & Images' or disallow images with dimensions larger than xxx pixels?

    3167 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.