Wordpress "out of memory" when uploading large images

19 replies
  • WEB DESIGN
  • |
Hi, I'm faced with yet another Wordpress problem. I've searched all of looking for a resolve but am yet to come across one...

When uploading large images into a post I get this message after the bar gets to 100%, says crunching, then it comes up:

Fatal error
: Out of memory (allocated 32243712) (tried to allocate 10368 bytes) in /homepages/35/d325471604/htdocs/dadcars/wordpress/wp-includes/media.php on line 255

The funny this is though is that the images do get uploaded fine, so I don't see what the actually error is doing/not doing? I have noticed they do not resize properly on one page, though.

Anyone?

Joe
#images #large #out of memory #uploading #wordpress
  • Profile picture of the author joetann
    I should mention I have tried creating php.ini and placing it into /includes with this content:

    ;; set memory limit for media.php
    memory_limit = 32M


    I've also tried adding

    php_value memory_limit 32M


    to my .htaccess, but I just get an internal server error.
    Signature

    https://www.letscommence.com/ - better logo design briefs for designers
    {{ DiscussionBoard.errors[3739789].message }}
    • Profile picture of the author dassad
      Originally Posted by joetann View Post

      I should mention I have tried creating php.ini and placing it into /includes with this content:

      ;; set memory limit for media.php
      memory_limit = 32M


      I've also tried adding

      php_value memory_limit 32M


      to my .htaccess, but I just get an internal server error.
      If it's not your server you can put any php.ini file if is not enabled from your host. I mean futting the new php onfiguration file is ok, but you don't will get a bigger limit only that the maximum specified by your host. You should contact them and ask if their can increase your upload limit

      For example Hostgator allows 64MB, but this really depends on your hosting

      Regards,
      daSSad
      {{ DiscussionBoard.errors[3739814].message }}
  • Profile picture of the author joetann
    Thanks man Do you know 1&1's limit is?

    Also, is it definitely this problem would you say?

    Thanks!!
    Signature

    https://www.letscommence.com/ - better logo design briefs for designers
    {{ DiscussionBoard.errors[3740271].message }}
    • Profile picture of the author dassad
      Originally Posted by joetann View Post

      Thanks man Do you know 1&1's limit is?

      Also, is it definitely this problem would you say?

      Thanks!!

      Hmm not sure since i had problems for example with NEXTGEN gallery, at Hostgator, and i tried to upload only 1-2 Mb files but still got the error.
      Do you have the error with this plugin?

      I don't remember which site was and how i resolved it, but if this is your problem to than i stumble for that site.
      {{ DiscussionBoard.errors[3740373].message }}
  • Profile picture of the author Istvan Horvath
    Let's go back to the basics:
    When uploading large images into a post
    Obvious questions:
    - why do you need to upload large images?
    - why do you want that your visitors hate you? (while waiting for the huge images)
    - why don't you re-size your images before uploading?
    Signature

    {{ DiscussionBoard.errors[3740594].message }}
    • Profile picture of the author Revolves
      Originally Posted by Istvan Horvath View Post

      Let's go back to the basics:

      Obvious questions:
      - why do you need to upload large images?
      - why do you want that your visitors hate you? (while waiting for the huge images)
      - why don't you re-size your images before uploading?
      Istvan does have a point. Joe, can you reassess your need for uploading large images? Looking at the error message, WordPress has already allocated a little over 30 MB for the file.

      However, if you absolutely must upload them, you could use FTP instead of WordPress' upload feature.

      -Revolves
      {{ DiscussionBoard.errors[3740761].message }}
      • Profile picture of the author jamesg3
        Here is an easy fox for that . Create a php.ini file and add this to it.
        Code:
        register_globals=Off
        safe_mode=off
        magic_quotes_gpc=On
        allow_url_include=Off
        file_uploads=on
        memory_limit=128M
        max_executi alt=90
        post_max_size=10M
        upload_max_filesize=10M
        max_input_time=300
        then in your HTaccess file add this line to it
        Code:
        SetEnv PHPRC /home/your server username/public_html/php.ini
        and change the your server user name to your server user name. This will force the limits to be higher and free up that error. If you need an help with this, I do these everyday. you can find me at serious website design dot com
        Signature
        Serious Wordpress sites, html/css sites and flash sites Cheap. I provide killer SEO, easy to use e-commerce solutions and payment gateways. Check me out at Serious Website Design.
        Need Hosting with serious speed and power? 3.99 a month. Take a look here. Serious Website Hosting.
        {{ DiscussionBoard.errors[3741070].message }}
  • Profile picture of the author Sleaklight
    This problem typically happens when there is not enough RAM on the server.
    {{ DiscussionBoard.errors[3740604].message }}
  • Profile picture of the author joetann
    Thank you for all the responses!

    Well the need for large images is the website is for my father who is not tech savvy at all. It is a car website where you can upload images, and other car traders are also able to upload images. It's not practical to ask all these non tech savvy people to resize before they upload their images.

    Trying the different workarounds offered now, thank you! I will report back on which works
    Signature

    https://www.letscommence.com/ - better logo design briefs for designers
    {{ DiscussionBoard.errors[3741109].message }}
    • Profile picture of the author jamesg3
      Ok, in your case you would want a image re-sizer to be working in the background when members upload their images. It would handle all of that for you very easily. Also, you could add a disclaimer to the upload area that would state something along the lines of "please set your phone camera to 1 megapixel or lower when taking images to upload, lol. Its sounds simple but it has worked for me in the past, lol. A image resizer script can be created easily for less than 75 bucks from a decent developer. I have a couple at work in the sites I have developed for others, Take a look at serious website design dot com. Let me know if yiou need some help with it.
      Signature
      Serious Wordpress sites, html/css sites and flash sites Cheap. I provide killer SEO, easy to use e-commerce solutions and payment gateways. Check me out at Serious Website Design.
      Need Hosting with serious speed and power? 3.99 a month. Take a look here. Serious Website Hosting.
      {{ DiscussionBoard.errors[3741356].message }}
  • Profile picture of the author joetann
    Hi Jamesg. I tried your suggestion but I'm afraid it didn't work either :/

    Will I need to have to email 1and1?

    Is there a plugin available which could possible sort this?
    Signature

    https://www.letscommence.com/ - better logo design briefs for designers
    {{ DiscussionBoard.errors[3747997].message }}
  • Are you getting your fair share of PHP memory?

    use the link above. Most hosts are restricting you. They lie. run this and you will see what they are really giving you. I have been battling this issue for months and this gave me proof my host was lying.

    CONSPIRACY!! lol

    Enjoy.
    {{ DiscussionBoard.errors[8050219].message }}
  • Profile picture of the author Daniel Fonda
    Hello. I'm almsot positive that it's your hosts fault. COntact them and address the issue, they should be able to fix it by providing you with more memory.
    Signature
    {{ DiscussionBoard.errors[8050324].message }}
  • Profile picture of the author kpmedia
    That's not the host's fault.

    They'll say the same thing.
    Either upload smaller images, or get a VPS to customize the environment to allow for it.

    Most hosts are restricting you. They lie.
    Not at all. 48M is reasonable for shared hosting.
    Not enough RAM? Upgrade your hosting. Get a VPS or dedicated.
    {{ DiscussionBoard.errors[8051878].message }}
  • Profile picture of the author Patrick
    No need to change the hosts or anything.

    Editing wp-config.php « WordPress Codex

    This will MOST likely solve your problem.
    {{ DiscussionBoard.errors[8051954].message }}
    • Profile picture of the author Kingfish85
      Originally Posted by Sleaklight View Post

      This problem typically happens when there is not enough RAM on the server.
      No, this is not true. There are limits in place for a reason. Find yourself a host that doesn't put limits like this in place and see how fast those servers slow to a crawl.

      Originally Posted by Dynamite Marketing View Post

      Are you getting your fair share of PHP memory?

      use the link above. Most hosts are restricting you. They lie. run this and you will see what they are really giving you. I have been battling this issue for months and this gave me proof my host was lying.

      CONSPIRACY!! lol

      Enjoy.
      Again, there are limits in place. See my reply above. As long as there aren't 2,000 accounts jammed onto a junk server, increasing the upload limit a bit won't hurt much.

      Originally Posted by kpmedia View Post

      That's not the host's fault.

      They'll say the same thing.
      Either upload smaller images, or get a VPS to customize the environment to allow for it.


      Not at all. 48M is reasonable for shared hosting.
      Not enough RAM? Upgrade your hosting. Get a VPS or dedicated.
      ^This, and this exactly.

      Keep in mind that no matter what you put in your custom php.ini file, most settings cannot be changed. Most of the limit settings cannot exceed the php configuration either.
      Signature

      |~| VeeroTech Hosting - sales @ veerotech.net
      |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
      |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
      |~| Visit us @veerotech Facebook - Twitter - LinkedIn

      {{ DiscussionBoard.errors[8053115].message }}
  • Profile picture of the author jay walters
    could it be a site security or something?

    Case 1: I had a friend who recently had some problem of loading slow and an error shows when creating a wordpress account and uploading images on his site. His hosting bandwidth got a warning which shows something like almost full memory... we check the file manager and deleted some old wordpress sites which were not used until it has been freed. So far everything went well.

    Case 2: Another friend of mine reported a slow site upload and also an error on uploading similar to memory full or something. When he reported it, the support team just said that the problem is on his side. When he referred the problem to another friend, they seem to notice a lot of traffic into the site and found out a lot of spam bots and unknown IP's have been using his bandwidth... it could be a low security thing... i don't know what hosting company is but let's just be careful.
    {{ DiscussionBoard.errors[8062134].message }}

Trending Topics