WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fatal error: Allowed memory size.... (28 posts)

  1. kosmikkreeper
    Member
    Posted 5 years ago #

    I've read most of the topics on this subject. But I still can't upgrade to 2.7.1

    I called my server and php memory is at 32MB and cannot be increased.

    Is there a work around?

  2. khmedia
    Member
    Posted 5 years ago #

    Will you please tell the problem in detail. Which PHP memory are you talking about.

  3. kosmikkreeper
    Member
    Posted 5 years ago #

    I didn't know there was more than one kind of php memory. :)

    This is the message I get when I try to upgrade: "Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1853353 bytes) in /home/imag5621/public_html/yanikphotoschool/wp-includes/http.php on line 1027".

  4. khmedia
    Member
    Posted 5 years ago #

    The error normally occurs when PHP tries to process a big database
    records or when importing or exporting. To solve the error, there are two resolutions. One is to change and increase the memory limit of the particular PHP script by adding or including an additional line at the top of the script:

    ini_set(”memory_limit”,”16M”);

    You can assign the memory limit to any amount you like by changing the 16M to other number, such as 12M or 24M. 16M will set the memory limit to 16 megabytes. If this doesn’t work and the PHP error still appearing, increase the memory limit until the PHP scripts running perfectly or the limit of your system hardware.

    To change the memory allocation limit permanently for all PHP scripts running on the server, modify the PHP.INI configuration file of the server (location depending on your OS and installation method). Search for memory_limit after opening the file in an editor. If the memory_limit doesn’t exist, add the following line. If it’s there, modify the value of the memory_limit:

    memory_limit = 12M

    The 12M sets the limit to 12 megabytes (12582912 bytes). Change to the value you desirable.

    An alternative way is to modify your PHP scripts that generate the error for more efficiency and better data handling.

    Extracted from My Digital Life

  5. kosmikkreeper
    Member
    Posted 5 years ago #

    Fixed it. All I had to do was deactivate all my plugins, update, reactivate the plugins. :)

  6. Muzzlewump
    Member
    Posted 5 years ago #

    @etdsbastar You are the Cyborg!!

    Thanks, I just called my host and fixed the problem now that I knew it was the php.ini file.

    Muzzlewump.com

  7. mcbalz
    Member
    Posted 5 years ago #

    I have two separate WP blogs that were working fine yesterday, and today are crashed out, giving the following error (each is slightly different in the numbers, but the same message).

    Blog One:
    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 4864 bytes) in /home/mcbalz/public_html/eschata/wp-includes/default-widgets.php on line 613

    Blog Two:
    Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 19456 bytes) in /home/mcbalz/public_html/training/wp-includes/default-widgets.php on line 547

    I am having this problem but I haven't been able to fix it by changing he wp-settings.php file as suggested in one Forum thread.

    I have checked the MySQL databases and both of my blog databases are well under 2 MB! These are small private blogs.

    This is emphatically NOT a problem related to the size of the actual database... what is going on?

  8. guillep2k
    Member
    Posted 4 years ago #

    In my case I just added the following to my wp-config.php right before the 'stop editing' comment:

    if( $_SERVER['SCRIPT_FILENAME'] == ABSPATH.'wp-admin/update-core.php' ) ini_set("memory_limit","64M");

    Of course, that won't work for everybody, but for its simplicity it's worth the try.

  9. husar
    Member
    Posted 4 years ago #

    I just added..

    ini_set("memory_limit","64M");

    ... to the top of my wp-config and no issues.

    Cheers.

  10. Mosher
    Member
    Posted 4 years ago #

    I just tried Husar's solution and received the following error when I refreshed:

    ini_set("memory_limit","64M"); //Hopefully resolve memory issue
    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/8/d151455252/htdocs/Weblog/wordpress/wp-config.php:3) in /homepages/8/d151455252/htdocs/Weblog/wordpress/wp-content/plugins/zemanta/zemanta.php on line 609
    
    Warning: Cannot modify header information - headers already sent by (output started at /homepages/8/d151455252/htdocs/Weblog/wordpress/wp-config.php:3) in /homepages/8/d151455252/htdocs/Weblog/wordpress/wp-includes/pluggable.php on line 865

    Without the edited file, I get an error:

    Fatal error: Out of memory (allocated 32505856) (tried to allocate 4096 bytes) in /homepages/8/d151455252/htdocs/Weblog/wordpress/wp-includes/media.php on line 345

    ...when I try to upload image files. This happens on two blogs, both hosted by the same provider but using separate WP installs. The image files are only 270kB or thereabouts!

    Anyone?

  11. bh_WP_fan
    Member
    Posted 4 years ago #

    If you are getting "Fatal error: Out of memory (allocated 32505856)" That shows that your memory_limit has not been increased to 64M, otherwise the error would not appear, or, if it did, it would show "Fatal error: Out of memory (allocated 67108864)" or something like that. If you were not able to increase your memory_limit in that way, try one of the other 2 ways, or contact your host to see how you can increase it (if they will let you).

    1. Increase the memory limit setting in php.ini e.g. (memory_limit = 64M ;). Many hosts may not allow this.
    2. Increase the memory limit via .htaccess e.g. (php_value memory_limit 64M). Many hosts may not allow this.
    3. Increase the memory limit via wp-config.php e.g. (define('WP_MEMORY_LIMIT', '64MB');)

  12. Mosher
    Member
    Posted 4 years ago #

    1. Can't do - no access to php.ini file

    2. Broken images relating to any plug-ins on the blog site and error when accessing the admin area:

    Error 500 - Internal server error
    
    An internal server error has occured!
    Please try again later.

    3. Any access to site results in:

    Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 77824 bytes) in /homepages/8/d151455252/htdocs/Moshtour/wordpress/wp-includes/functions.php on line 3295

    Revoked change in wp-config.

    Would someone be kind enough to explain why this error's started appearing as a lot of people seem to have been hit by it recently. I can only assume it's something relating to a recent upgrade? I'm currently running v2.8.4 for the two blogs with issues.

    As a test, I uploaded the same photos to an old blog that's still on v2.3.2 on the same server and there's no problem with that.

  13. bh_WP_fan
    Member
    Posted 4 years ago #

    Disable all of your plugins by renaming the plugins directory. It is likely that a plugin is contributing to it, or causing it entirely but exceeding 24M isn't too uncommon on a WordPress blog. There should be no problems caused by increasing your memory_limit. I would suggest contacting your host and seeing how to get it increased.

  14. Mosher
    Member
    Posted 4 years ago #

    For interest, disabling all plug-ins solved the problem. I managed to get two going before adding a third (WP-Stats), re-introduced the issue. I enabled all plug-ins except for that one... and the problem returned. So either there is more than one plug-in specifically causing the problem or it's just the volume of them.

    I'll try mailing my host (1&1) though I don't know what their policy will be.

  15. tehflakes
    Member
    Posted 4 years ago #

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 491520 bytes) in /home/tehflake/public_html/wp-includes/class-simplepie.php on line 4134

    How can I get rid of this problem?

    ryan
    tehflakes.ca

  16. bh_WP_fan
    Member
    Posted 4 years ago #

    Did you try reading any of the above posts?
    The answers you need are all there.

    1. Increase the memory limit setting in php.ini e.g. (memory_limit = 64M ;). Many hosts may not allow this.
    2. Increase the memory limit via .htaccess e.g. (php_value memory_limit 64M). Many hosts may not allow this.
    3. Increase the memory limit via wp-config.php e.g. (define('WP_MEMORY_LIMIT', '64MB');)

    4. Try disabling all plugins. You can rename your plugin directory for a quick disabling.

  17. Morten Ross
    Member
    Posted 4 years ago #

    Hi,

    Disabling all plugins does not help.

    I have also found an illogical pattern:

    Uploading a file of size x is successful while the next file of smaller size y will fail. This in same post. So a larger sized file will succeed while a smaller will fail... Decreasing the file even more will in fact display an even larger byte size allocation error.

    My ISP does not allow larger than 25 MB, so that that - none of the options suggested here in regards to increased memory allocaiotn pool will work for the likes of me.

    This does indeed seem to be a problem in WP 2.8.4. Seems memory allocation requirement is excessive. How to decrease the excessive memory usage?

    How do we resolve this?

    Morten

  18. ozzy10
    Member
    Posted 4 years ago #

    i had this error and its caused by having too many plug-ins loaded in at once.
    If you disable the ones you actually don't need , the error goes.

  19. Samuel B
    moderator
    Posted 4 years ago #

    i had this error and its caused by having too many plug-ins loaded in at once.
    If you disable the ones you actually don't need , the error goes.

    that is most certainly usually true
    however, sometimes php really does run out of memory

  20. sundog02
    Member
    Posted 4 years ago #

    Husar's comment did it for me on two blogs. Thanks! Upgraded to 2.8.5

    Their comment:

    I just added..

    ini_set("memory_limit","64M");

    ... to the top of my wp-config and no issues.

    Cheers.

  21. sozemediagroup
    Member
    Posted 4 years ago #

    Above this or below it

    /**
    * The base configurations of the WordPress.
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
    * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation. You don't have to use the web site, you can just copy this file
    * to "wp-config.php" and fill in the values.
    *
    * @package WordPress

  22. sozemediagroup
    Member
    Posted 4 years ago #

    Sorry forgot to add a question mark to that

  23. gas01ine
    Member
    Posted 4 years ago #

    hi everybody!

    i get the same allocation problem when trying to upload images.

    That's my error message

    Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 4096 bytes) in /home/.sites/897/site245/web/blog/wp-includes/media.php on line 345

    what i did:

    • define('WP_MEMORY_LIMIT', '64M');-- didn't work.
    • "deactivate all plug-ins" -- i am only using one and that wasn't the problem.

    on closer inspection on said line in said php-file there is the following expression
    $newimage = imagecreatetruecolor( $dst_w, $dst_h);

    Interestingly I only get the error message if an image exceeds certain dimensions. Usually the images i try to upload are 1280*853; if i try uploading a little smaller images it works no problemo; like 1280*734.

    can any of you folks help me out on this? help would be much appreciated!

  24. Der_Matze
    Member
    Posted 4 years ago #

    Hey gas01ine and all the others

    I had the same problem. I tried to increase the Memory in the wpconfig.php and the php.ini. Both did't solve the problem.

    But then i had a look in the Settings (In the left column of the adminarea.) I have the german version so it is "Einstellungen -> Mediathek" i don't know what it's in english. Maybe Settings -> Media just to have a guess...

    There you can adjust the max width and height of your images.

    Well it's working now, although not for all images. I set the max height and width to 4000 pixels each, but still encountered the problem with an image of approx. 3400 x 2000 pixels. An image of 3000x2000 worked fine. Well maybe it helps.

  25. Waywyn
    Member
    Posted 4 years ago #

    Hey,

    I am sorry to chime in here, but I have the same problem, but went through the first 10 topics within the forums and tried various things.

    I tried to:

    - disable all plugins
    - disable all widgets
    - upgrade to 2.8.6, downgrade to 2.7.
    - cleaned out some unnecessary entries from very old plugins in the database I don't need anymore
    - the website already needs around 128MB and isn't working even on 96MB or lower.
    - I also tried to enter this command of 64MB in the config which was recommended througout the forum

    I don't know what to do really. Anyway has some help?
    I mean the website runs stable at 128MB, but I just ask myself how long?
    It outmaxed 64MB, then 96MB, how long will it work at 128MB?

    This tells me that something goes up in an endless string somehow.
    However I am no coder etc. but I have logic understand that it has to be something like it.

    Even though it stays stable at 128MB, it is wayyyy to much for a simply wordpress website and a few tiny not even hardcore plugins :)

    Thanks so much for any help in advance!!

    Cheers,

    Alex

  26. littlecuriosity
    Member
    Posted 4 years ago #

    Is there any way to fix this error without deactivating the plugins?

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4096 bytes) in /home/artygirl/public_html/wp-includes/media.php on line 345

  27. littlecuriosity
    Member
    Posted 4 years ago #

    I've found a naughty solution. I renamed the plugins folder which luckily doesn't delete my blogs widget settings etc, uploaded the files then renamed the plugins folder back. I wouldn't recomend doing this though if you have a client admin system. I plan to test flickr as an alternative!

    There something wrong with plugin compatibility in the recent wordpress

  28. littlecuriosity
    Member
    Posted 4 years ago #

    Note: I was also able to upgrade wordpress mu doing this! If you have customers like me its a good idea to do to ugrade at 3 in the morning as its least likely you'll find them looking at your site at that time!

Topic Closed

This topic has been closed to new replies.

About this Topic