1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Attachment Upload Fails Sometimes

Discussion in 'Troubleshooting and Problems' started by owls8521, Jul 8, 2011.

  1. owls8521

    owls8521 Active Member

    I've been trying to attach pngs to my messages, but there are some pngs that won't upload. The bar gets stuck at 100%. They are all different dimensions and sizes, and I don't notice anything consistent about the ones that don't work. Here is the error that is showing up in the console in Google Chrome.

    Invalid JSON: <br/> <b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8000 bytes) in <b>/home/owls8521/explodingrabbit.com/forum/library/XenForo/Image/Gd.php</b> on line <b>77</b><br/>
     
  2. Digital Doctor

    Digital Doctor Well-Known Member

    is the attachment on a Networked Drive ? or a Local drive ?
    Chrome Version ?
     
  3. owls8521

    owls8521 Active Member

    Local drive. Chrome version is 12.0.742.112. It also happens in Firefox 5.0.
     
  4. Digital Doctor

    Digital Doctor Well-Known Member

  5. Digital Doctor

    Digital Doctor Well-Known Member

    Cool game ! :)

    Are you able to reset your server ?
     

    Attached Files:

  6. owls8521

    owls8521 Active Member

    Thanks!
    Yes I can. I'm on a virtual private server with Dreamhost. I don't really understand the stuff you linked to earlier.
     
  7. Digital Doctor

    Digital Doctor Well-Known Member

    You are out of memory.
    Reset the server and see if it goes away ... if it doesn't things look harder from there.
    Some of these troubles might stem from the hackers :)
     
  8. owls8521

    owls8521 Active Member

    I rebooted the server and the problem still persists. So there is something wrong with my server? I guess I'll contact customer support for Dreamhost.
     
  9. Digital Doctor

    Digital Doctor Well-Known Member

    Are you able to increase the size of the memory .... or shut down some processes ?
    The host might be able to give you some more information about what is eating up the memory.
     
  10. owls8521

    owls8521 Active Member

    The memory problem only happens when I upload certain png files. Otherwise it seems fine. I have graphs that show me the memory and it is well below the limits.
     
  11. Digital Doctor

    Digital Doctor Well-Known Member

    http://www.tech-recipes.com/rx/777/...memory-size-of-8388608-bytes-exhausted-tried/

    You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server’s php.ini file:
    memory_limit = 12M

    of course that is too low for you ... you are running out at 134217728 bytes
    memory_limit = 160M might work .... but that sure seems like alot.
    This is a common problem that is for sure. [link].
     
  12. Digital Doctor

    Digital Doctor Well-Known Member

    How big are the files ?
     
  13. owls8521

    owls8521 Active Member

    200 - 300 KB

    Edit: Some files that are bigger than that still work though. I don't know why certain ones cause the memory error.
     
  14. Digital Doctor

    Digital Doctor Well-Known Member

    in Gd.php on line 77 .. see if there is something in there that restricts memory to a certain size.

    This might help:
    http://www.google.ca/#sclient=psy&h...c.r_pw.&fp=9ae63e6cb8d9c774&biw=1050&bih=1565

    Try this first:

    http://xenforo.com/community/threads/fatal-error-image-gd-php-on-line-56-upgrade-attachment.7604/
     
  15. Digital Doctor

    Digital Doctor Well-Known Member

    search xenforo.com for: 134217728 [link]
    lots of entries :)
     
    owls8521 likes this.
  16. owls8521

    owls8521 Active Member

    Oh thanks. I tried searching before but didn't search for that number.
     
  17. Digital Doctor

    Digital Doctor Well-Known Member

    XF sets the memory limit to 128M itself. You can set it in config.php:
    ini_set('memory_limit', 256 * 1024 * 1024)

    167772160 = 160 Megs.

    ini_set('memory_limit', 160 * 1024 * 1024) or
    ini_set('memory_limit', 167772160)

    source
     
  18. owls8521

    owls8521 Active Member

    Yeah I saw that. I think it's happening because it's trying to create thumbnails for really big images and I guess that takes up a lot of memory. I'll just set a limit on the dimensions people can upload. I was trying to upload an image that was 8000 x 8000 pixels. I didn't know that uploading a higher resolution image used up more memory than a smaller one. I thought only the file size mattered.

    Thanks for your help, Digital Doctor. I learned a lot.
     
  19. Digital Doctor

    Digital Doctor Well-Known Member

    Yea. I read that too.
    No problem.
    Good luck :)
     

Share This Page