• Resolved jonasbj

    (@jonasbj)


    Hello! I’ve tried to google this topic, and I’ve also tried searching on this forum, but none of the solutions have beeen helpful for me. I’ve tried both to add an .htaccess-file, I’ve tried to change limits in wp-config and wp-settings, but notings seems to help.

    The problem is that when I try to upload a picture on my wordpress-page it seems OK until the uploader is going to crunch the picture. Then this message appears:

    Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 13824 bytes) in /home/virtual/****/public_html/****/wp-includes/media.php on line 258

    I’m using the theme Twenty Eleven and version 3.4 of WordPress.

    This is a totally fresh install of wordpress on my host. That means that there is no plugins which makes it difficult. And as mentioned above I have tried to change the limits in the files.

    I do not have access to the php.ini-file.

    I have never had such problems with earlier versions of WordPress, and I think that there should be enough php-memory available since there is nothing else installed on the host.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter jonasbj

    (@jonasbj)

    If i remove the line 258 in media.php the error disappeares, but the images are then not crunched, and is uploaded in full size.

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

    I have this exact problem – only happened since upgrade to 3.4. The image actually upload to the media library but memory gets exhausted while try to crunch.

    I have edited php.ini to:
    memory_limit = 100M
    upload_max_filesize = 100M
    post_max_size = 100M
    file_uploads = On

    And edited wp-config to include:
    define(‘WP_MEMORY_LIMIT’, ‘100M’);

    PHP config through cpanel shows:
    memory_limit = 32M
    upload_max_filesize = 20M

    But to no avail!

    Please can someone advise why this has all of a sudden become an issue??

    Please post your own topic.

    Thread Starter jonasbj

    (@jonasbj)

    My host is not able to increase the memory size in php.ini (it’s currently at 48M), and they claim that there is nothing they could do.
    “It got nothing to do with the used space on the webhotel. It’s the process of uploading the file and the file itself that takes PHP memory.” they say.

    But why does this upload suddenly takes so lot of memory? Do I have to return to Drupal to get a proper working blog?

    Thread Starter jonasbj

    (@jonasbj)

    Fixed it by adding an .htcaccess-file.

    Hi jonasbj,

    Fixed it by adding an .htcaccess-file.

    What specifically did you put into this file?

    Mine looks like this:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Any help would be appreciated! I am having this issue on several installs.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error in media.php when uploading image’ is closed to new replies.