• Resolved Lorfarius

    (@lorfarius)


    Bit of a nightmare situation but I’m trying to sort out a page for offering my sites magazine this weekend. Everytime I upload an image I get this:

    Fatal error: Out of memory (allocated 33030144) (tried to allocate 10908 bytes)in/homepages/33/d341810024/htdocs/wp-includes/media.phpon line253

    I’ve removed a few plugins and tried deactivating several to no joy.

    This is what the contents of my php.ini looks like, following an earlier suggestion from here many moons ago to change the memory figures:

    memory_limit = 512M
    memory = 124MB
    max_execution_time = 600
    upload_max_filesize = 40M
    allow_url_fopen = On

    Can anyone help, I’m desperate?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Two options:

    1. Decrease the size of the images that you are trying to upload
    2. Contact your hosts and ask them to raise your memory limit. Your changes to your php.ini file obviously aren’t working as you only have 32M of PHP memory.

    Thread Starter Lorfarius

    (@lorfarius)

    Fixed 🙂 I decreased the image size and it worked! Thank you sssoooo much!

    Are you certain nothing is overriding the memory_limit value from php.ini? Easiest way to check is to create a file called info.php at webroot with the following code in it:

    <?php phpinfo(); ?>

    Then just got to http://yoursite.com/info.php

    If the value show for memory_limit isn’t 512M, you’ve got something in WordPress telling PHP to use another value.

    If that’s the case you can try a few things.

    1) In the file that’s throwing the error (in your case, wp-includes/media.php) you can add:
    ini_set(‘memory_limit’, ‘512M’);
    immediately before the line that is throwing the error (line 253 according to your error text).

    2) If that doesn’t work, you could try it from the .htaccess file and add this:
    php_value memory_limit 512M

    3) You can also set it from wp-config.php by adding this code:
    define(‘WP_MEMORY_LIMIT’, ‘512M’);

    512M is pretty high, though. I don’t think I’ve ever had a site where I’ve had to increase it to more than 128M. It may simple be that your webhost has it set low, and what you did previously didn’t successfully override their value.

    Edit: Or decrease the image size. 🙂 I need to learn to type faster.

    Thread Starter Lorfarius

    (@lorfarius)

    No that’s great! There’s bound to be a time when it happens again knowing my luck so I’ll keep note 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error: Out of memory Issue’ is closed to new replies.