The MU forums have moved to WordPress.org

Chronic PHP fatal memory error (22 posts)

  1. LanceGrigsby
    Member
    Posted 9 years ago #

    Running WordPress MU 1.2.3-2.2.1 on a Windows box using PHP 5.2.3.3 and Apache 2.2. I'm experiencing frequent PHP memory errors (and thus, Apache crashes) that look like this:

    PHP Fatal error: Out of memory (allocated 2359296) (tried to allocate 393216 bytes) in \\wp-includes\\query.php on line 935.

    The common thread seems to be that with every error, a file in the wp-includes directory gets referenced. Most often, however, it's the cache.php file. Referring URLs in the error log indicate Apache craps out as someone is doing something in the dashboard (as I assume the admin UI is where most of the include files get called from).

    Lastly, we've tried deactivating some plugins we suspected as the culprits and even adjusting PHP's memory. No dice. Read many, many threads on the web about similar errors--again, most reference files in the wp-includes directory--but no solutions.

    Any help is appreciated.

  2. MrBrian
    Member
    Posted 9 years ago #

    You might try the latest version of WPMU to see if that has any effect on the memory getting burned and also i'm assuming you are running it locally since it's on a windows box? Try reinstalling your apache/php environment with xampp/wamp.

  3. LanceGrigsby
    Member
    Posted 9 years ago #

    Yeah, running locally. Our installation is a bit out of the ordinary because we're using it with SSL and the ldap plugin, so that's slowing down our upgrade path since we basically implmented SSL brute force--but we just got a test box to start testing with the upgrade and I'm reading good things about stronger support for SSL with WPMU. Upgrading is the obvious solution, but that can't happen for a while. I'll look into xampp/wamp. Thanks.

  4. SteveAtty
    Member
    Posted 9 years ago #

    What is your PHP memory_limit set to? That allocated number looks rather low

  5. LanceGrigsby
    Member
    Posted 9 years ago #

    Not sure at the moment--our programmer did this. Where WOULD it need to be set? php.ini only, or do other files control this behavior? We're not using WAMP or anything ... each component of our installation is installed separately.

  6. SteveAtty
    Member
    Posted 9 years ago #

    It should be in your php.ini file

    Can't remember where that hides on Windows but you should be able to find it easily

  7. LanceGrigsby
    Member
    Posted 9 years ago #

    Actually, php.ini is showing memory-limit: 512M. It was 128, but we changed it to see if it would make a difference, but so far, hasn't.

  8. SteveAtty
    Member
    Posted 9 years ago #

    And you've restarted everything since you changed your php config?

    Do you have an info.php file which can show all your php config parameters?

  9. LanceGrigsby
    Member
    Posted 9 years ago #

    Tryin' to find it ... not sure. But I'm fairly certain we've restarted our system several times since then, particularly for Windows updates. Where should info.php be?

  10. MrBrian
    Member
    Posted 9 years ago #

    He just means a file with <?php phpinfo(); ?> which outputs a bunch of, yeah you guessed it, php info.

  11. LanceGrigsby
    Member
    Posted 9 years ago #

    OK, just created the info file and it's showing memory_limit to be 512M. Any other things I need to look for in the configuration?

  12. VentureMaker
    Member
    Posted 9 years ago #

    Can you show the whole output of the file?

  13. LanceGrigsby
    Member
    Posted 9 years ago #

    For security reasons, I'd rather not. But I'll be happy to look at a certain aspects of our configuration for you if it's relavent to this thread. Is there anything aside from memory_limit that could be a factor here?

  14. VentureMaker
    Member
    Posted 9 years ago #

    safe_mode, post_max_size, max_execution_time, disable_classes and disable_functions if any

  15. SteveAtty
    Member
    Posted 9 years ago #

    Its why its reporting memory problems if its set that high. Either there is a duff plugin somewhere doing a really bad query or there is something odd going on. Trying to allocate about 300K in one shot would imply a big results set coming back, But the allocated is only just over 2M so it shouldn't blow up like that.

  16. LanceGrigsby
    Member
    Posted 9 years ago #


    safe_mode = off
    post_max_size = 8M
    max_execution_time = 30
    disable_classes = no value
    disable_functions = no value

    Steve, not sure I understand.

  17. davidctaylor
    Member
    Posted 9 years ago #

    Yeh, I'm not following either (I work with Lance). You say the allocated is "just over 2M" but I don't understand what you are referring to. I see that it tried to allocate 393216 bytes, so you are saying that whatever limit that would contstrain that *IS* high enough? Hmmm...

  18. lunabyte
    Member
    Posted 9 years ago #

    Just to throw this in, 512M for your memory allocation in php.ini should be more than plenty.

    Does this occur on any specific page, or all of them?

    As was stated previously, start looking towards plugins. Turn them all off, and see if it clears. If so, turn them back on one by one.

    If turning off plugins didn't change anything, start looking at your changes to the core.

  19. SteveAtty
    Member
    Posted 9 years ago #

    What is the max packet size in your mysql config file? (max_allowed_packet)

  20. davidctaylor
    Member
    Posted 9 years ago #

    Interesting. I looked in my.ini and this parameter is not set at all. It must be defaulting to whatever the default value is. What is a good size to have it set to? 1M?

  21. SteveAtty
    Member
    Posted 9 years ago #

    Mine is set to 56M so that I can do some really rather large queries (there is another database with blobs in it on the same server)

  22. davidctaylor
    Member
    Posted 9 years ago #

    Thanks--I'll try that. Are there any other parameters that have to be changed along with the max_allowed_packet?

About this Topic

  • Started 9 years ago by LanceGrigsby
  • Latest reply from davidctaylor