Support » How-To and Troubleshooting » [Resolved] Fatal error: Allowed memory size of 33554432 bytes exhausted

[Resolved] Fatal error: Allowed memory size of 33554432 bytes exhausted

  • New install of wordpress with Crazydomains….

    Was getting this error when trying to upload a 260kb pic through a post:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 15552 bytes) in /home/mydomain/public_html/blog_wp/wp-includes/media.php on line 253

    So, I finally gave up on this method (since I can’t edit anything to do with my php.ini) and decided to try a plugin “Add from Server”.

    I uploaded a larger pic 3mb, to a directory in my install, then tried importing with the plugin…. EXACTLY the SAME ERROR!

    Does anybody have any ideas?

Viewing 15 replies - 1 through 15 (of 32 total)
  • 1. If you have access to your PHP.ini file, change the line in PHP.ini
    If your line shows 32M try 64M:
    memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
    2. If you don't have access to PHP.ini try adding this to an .htaccess file:
    php_value memory_limit 128M
    3. Try adding this line to your wp-config.php file:
    Increasing memory allocated to PHP
    define('WP_MEMORY_LIMIT', '128M');
    4. Talk to your host.

    Thanks for the reply Samuel, but I would have thought this would only matter if the file wasn’t already uploaded to the server?

    EDIT: Sorry I should have also noted that even when I do get the error while uploading through WordPress, the image still gets an entry in the Media Library.


    1. I’ve spoken with my host and they’ve upped size from 32M to 64M
    2. I’ve also tried adding the line into wp-config.php

    Neither has give any results – still have exactly the same issue.

    All the files I’ve been testing with are jpg’s under 302kb!


    it’s not the size of the file, but php memory your are running out of
    I’m afraid 64M likely isn’t enough

    Can you suggest a size that will be enough? Then I’ll go back to my host and put in a request. Thanks for the reply Samuel.

    define(‘WP_MEMORY_LIMIT’, ‘128M’); or
    define(‘WP_MEMORY_LIMIT’, ‘256M’); or
    define(‘WP_MEMORY_LIMIT’, ‘512M’); provided that you have at least 1024 MB of megabytes of RAM.

    You must configure this on your wp-config.php under wp-cache true value or somewhere at the top.

    I’ve tried that already, but to no avail unfortunately…. I would be guessing there is plenty more than 1024 MB of ram, since it will be on hosted on a decent sized server… How much of that I’m allocated I’m not sure! Feels like 8MB!

    Edit: spelling

    Just to let everybody know, I finally got this problem fixed!
    Very easy in the end!

    Create a file called “php.ini” in the “wp-admin” folder of wordpress install.

    Add the following text to the file;

    memory_limit = 256M ;

    omg thanks harry!!! Your fix worked a charm.

    Much appreciated 🙂

    Thanks Harry, I’m with Crazydomains as well and this worked like a charm!

    if it helps…

    For a quick fix with crazydomains create the php.ini file in the wp-admin folder and add this code as is.

    memory_limit = 128M
    upload_max_filesize = 10M
    post_max_size = 10M

    This will allow you to upload files up to 10mb in size

    Is this something that only affects Crazy Domains, who I am also with?

    It fixed it for me as well
    Thanks all.




    Forum Moderator


    Finally, an open thread dedicated to this topic.

    The error I get is “Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 122880 bytes) in …/public_html/wp-admin/includes/dashboard.php on line 88”

    Which means that I don’t have access to the dashboard at all, so I can’t play with the plugins. But it can’t be a plugin/media induced error; last time I added / updated a plugin everything went fine, and there’s barely any plugins or media on my blog. The error occured when I tried updating to WordPress 3.2.1

    I wrote my provider, they said to edit the memory to 128M in wp-config. I added define(‘WP_MEMORY_LIMIT’, ‘128M’); in wp-config but it didn’t work. Neither did adding ini_set(“memory_limit”,”128M”);

    I added php_value memory_limit 128M to the .htaccess file, but it didn’t work.

    The wp-settings.php file doesn’t have any line mentioning the allowed memory limit, for me to change.

    I don’t seem to have access to the php.ini file, or at least I can’t find it.

    What to do next? 🙁

    Also, I applogize for any unintentionally broken rules, this is my first post.

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘[Resolved] Fatal error: Allowed memory size of 33554432 bytes exhausted’ is closed to new replies.