WordPress.org

Ready to get started?Download WordPress

Forums

Specific "out of memory" problem (4 posts)

  1. publicradio
    Member
    Posted 3 years ago #

    Hello,

    I try to upload an image that is 1.38 MB and get this error:

    Fatal error: Out of memory (allocated 34078720) (tried to allocate 14592 bytes) in /homepages/.../htdocs/wp-includes/media.php on line 254 (elipses mine)

    OK so the amount it tried to allocate is clearly less that what is allocated, so what's going on here?

    I added this line to wp-config.php, after define('ABSPATH', dirname(__FILE__) . '/');

    define('WP_MEMORY_LIMIT', '100M');

    I go to phpinfo.php and get this:
    upload_max_filesize 20M

    I go to 'upload new media' and get this:
    Maximum upload file size: 30MB

    I'm not too picky, and any of these upload sizes would be fine with me. However, if I can't even upload a 1.38MB photo, we've got a problem. I can upload a 300k photo but that's too low. Any suggestions?

  2. publicradio
    Member
    Posted 3 years ago #

    Oh, and here's another thing: it appears that these large photos actually do upload, after I get this error. I go to my media library and they are indeed there.

    Is there anything I can do to get rid of the error, though? I think it's going to throw my users.

    Thanks!

  3. Samuel B
    moderator
    Posted 3 years ago #

    I added this line to wp-config.php, after define('ABSPATH', dirname(__FILE__) . '/');

    define('WP_MEMORY_LIMIT', '100M');

    that won't be read as it's too far down
    just place it right after the opening php tag and make it 128M

  4. publicradio
    Member
    Posted 3 years ago #

    thank you for the reply. I moved it and this didn't help the problem.

    Another thing I've noticed is that with these large files, the main photo will post but it won't create any of the other sizes. When I upload a more reasonably-sized photo, it creates the thumbnails and other sizes.

Topic Closed

This topic has been closed to new replies.

About this Topic