WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fatal error: Allowed memory size of 33554432 bytes exhausted (33 posts)

  1. harry216921
    Member
    Posted 3 years ago #

    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?

  2. Samuel B
    moderator
    Posted 3 years ago #

    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.
  3. harry216921
    Member
    Posted 3 years ago #

    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.

  4. harry216921
    Member
    Posted 3 years ago #

    OK,

    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!

  5. harry216921
    Member
    Posted 3 years ago #

    Anybody?

  6. Samuel B
    moderator
    Posted 3 years ago #

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

  7. harry216921
    Member
    Posted 3 years ago #

    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.

  8. godsofchaos
    Member
    Posted 3 years ago #

    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.

  9. harry216921
    Member
    Posted 3 years ago #

    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

  10. harry216921
    Member
    Posted 3 years ago #

    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 ;

  11. electrifried
    Member
    Posted 3 years ago #

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

    Much appreciated :)

  12. snails07
    Member
    Posted 3 years ago #

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

  13. fusion330
    Member
    Posted 2 years ago #

    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

  14. nortont
    Member
    Posted 2 years ago #

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

    It fixed it for me as well
    Thanks all.

    Tim
    http://cctvdesign.com.au

  15. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    No.

  16. alex.mircea
    Member
    Posted 2 years ago #

    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.

  17. harry216921
    Member
    Posted 2 years ago #

    Alex,

    You need to create the php.ini file yourself, as mentioned in my post above....

    ------------

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

    Add the following text to the file;

    memory_limit = 256M ;

  18. prettypea
    Member
    Posted 2 years ago #

    Thanks so much! this fixed it for me too. Brilliant.

  19. JTZEnterprise
    Member
    Posted 2 years ago #

    I have the exact error in the dashboard.php page but no matter what I do I can not change the memory limit. php info shows the limit is actually much higher than the error indicates.

  20. alex.mircea
    Member
    Posted 2 years ago #

    Thanks Harry, creating the php.ini file didn't help either (and the WP freelancer who tried to help me was puzzled why none of the solutions doesn't work), but we eventually fixed the issue quite simply, by removing on the FTP all the temp files of the WP update and then making the update manually. Works just fine now. I'll probably find out at the next WP version release whether it was a temporary solution only.

  21. Osman Ozmen
    Member
    Posted 2 years ago #

    Thank you, Thank you and Thank you.
    I've registered this beautifull forum just to say THANK YOU to this post.
    I've been dealing with the same problem of "Allowed memory size of 33554432 bytes..." and having same results for every solution.
    Thank you harry216921, it was the fifth day of same problem. And finally, This solution works! :D

    Create php.ini that sets your "memory_limit" in other folders that creates problems too!
    Happy blogging everyone!

  22. Teiko
    Member
    Posted 2 years ago #

    This isn't working for me

    http://hidden-village.net/

    Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /home/hidvil/public_html/wp-includes/cache.php on line 431

    IT's really starting to annoy me.

  23. countstefan
    Member
    Posted 2 years ago #

    Thankyou to harry216921 this worked a treat for me I resolved the issue immediately.

    I am no PHP guru so this was a simple fix for me.

    Thanks again now I can trouble the inter-webs with my photos :-)

  24. ibireporter
    Member
    Posted 2 years ago #

    how can i increase my memory size while not opening my admin pannel

  25. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  26. Glen Thomson
    Member
    Posted 2 years ago #

    Amazing! Thank-you Harry, the php.ini file worked perfectly!

    I was having trouble doing ANYTHING without that accursed 'fatal error' message coming up.

    Many thanks also to all who contribute to these forums, I would imagine sometimes it isn't obvious that the help is being utilized. I can assure you however, there will be someone out there furthering their education based on your guidance :)

    Thanks again! Glen

    http://glenthomsonphotography.com

  27. akash10
    Member
    Posted 2 years ago #

    Just Deactivate your all plugins and upadate...
    and after that you can reactivate your plugin again......
    This is a best answer on wordpress.org

  28. waiyi
    Member
    Posted 2 years ago #

    harry,

    just want to say thanks!! it fixed my problem too!!!

    I didn't expect how simple is it!! :)

    waiyi

  29. kranthineo92
    Member
    Posted 2 years ago #

    omg it worked harry thanks alot........

  30. zemra
    Member
    Posted 2 years ago #

    well done harry216921

    it solved my problem that I had long time on my page http://inpropertyservices.com.au/

Topic Closed

This topic has been closed to new replies.

About this Topic