Support » Plugin: The Events Calendar » Fatal memory error under PHP 7

  • Resolved Andy Giesler


    This relates to the free version of Events Calendar that is bundled with the Avada theme.

    We have a working site that uses the Events Calendar, and I migrated it to another web host to create a staging site. Immediately I started having fatal memory errors whenever I tried to save edits to a page, and sometimes even before I could reach the page editor at all.

    These errors stopped immediately when I disabled the Events Calendar plugin. The errors looked like this:

    Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 2542620639840 bytes) in /[accountpath]/wp-includes/option.php on line 1115

    Our live server is using PHP 5 (point something). Our staging server is set up to use PHP 7 by default. When I “downgraded” PHP to 5.6 the problem stopped immediately.

    A couple of months ago, someone else reported an issue with PHP 7 but was told they were simply running out of memory. I wanted to re-raise this since that’s apparently not the case.

    My staging server host (SiteGround) is reasonably generous with RAM… and even if they weren’t, please note that the system crashed because it was trying to allocate 2.5 terabytes of RAM. So… yeah. No amount of WP_MEMORY_LIMIT voodoo is going to fix that kind of memory overrun.

    For the time being we’ll run with PHP 5.6, but I’d love to switch back to PHP 7 if this gets fixed.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Barry


    Sorry to hear it, Andy 🙁

    Can you tell me anything else about your installation? How many events – and how many posts in total – do you have in your database?

    These errors stopped immediately when I disabled the Events Calendar plugin.

    Good catch, though it’s possible this was compounded by a conflict with something else. Have you been able to run through these troubleshooting steps at all?

    Thread Starter Andy Giesler


    Thanks for checking in. We currently have only 6 events.

    At the time of the problems, I didn’t enable plugins one-by-one for testing. But this morning I spent an hour or so testing in case it helps you find the error. We have no problem right now because we can downgrade to PHP 5.6. But if you have a customer sometime who must use PHP 7, they might get into a more pressing situation.

    Results were strange.

    To check for the problem, I leave the page editor open for a test page and just do a browser refresh (F5).

    • Sometimes the error happens immediately.
    • Sometimes I need to update the page two or three times.

    There are four different kinds of errors.

    1. A memory error like the one I mentioned.
    2. “Fatal error: in [accountpath]/wp-content/plugins/the-events-calendar/src/Tribe/Asset/Factory.php on line 3”
    3. The page editor loads, but styles seem to be broken. Text in the content area is white on a white background, monospace font.
    4. White screen of death. WP_DEBUG is enabled, but no error message shows. When I view source, I see that the page abruptly stops generating in the head block in the middle of a Fusion Builder script block: type=”text/template” id=”fusion-builder-block-module-settings-table-template”.

    First, the straightforward part:

    1. Revert to PHP 7.0. Error.
    2. Disable all plugins, switch to Tewnty Fifteen. NO error.
    3. Enable Fusion Core, Fusion Builder, Events Calendar, and then switch to Avada. NO error.

    Then I started enabling additional plugins, leaving that core enabled (Fusion Core, Fusion Builder, Events Calendar).

    The weird part: errors start happening when I enable 2-3 other plugins. And not 2-3 particular plugins, but seemingly any 2-3 plugins. I confirmed with with several combinations of plugins, including completely non-overlapping subsets.

    In other words, it’s not like Events Calendar + one particular other plugin causes the error. If we imagine my plugins have letters for names:

    • enabling A = ok
    • enabling B = ok
    • enabling A+B = error
    • enabling C = ok
    • enabling D = ok
    • enabling C+D = error

    Reverting to PHP 5.6 ends the errors, even with a dozen plugins enabled.

    So it sure seems like some combination of Avada, Events Calendar, and PHP 7 are causing some fragility in the WordPress instance, making errors more likely as additional plugins try to add more functionality.



    Some great troubleshooting work there, though I’m admittedly unsure where to go next with this.

    Most of us internally use PHP 7.1 on a day-to-day basis and see nothing like this – we also know that many of our users similarly use PHP 7.x without hitting anything like this.

    There could certainly be something in what you’ve found for us to address, but I’m not sure we have enough to go on at this point to write up a meaningful bug report. On those occasions where you get a ‘white screen of death’ with no error, is anything written to the server error log?

    Thread Starter Andy Giesler


    Wish I could help more, but I’ve reached the limit of my time to investigate. Since we reverted to PHP 5 three weeks ago we haven’t had the error. So to investigate further, I have to reconfigure the site for PHP7 (and in doing so, break it).

    I’ll mark this thread as resolved since you can’t reproduce it. But please keep it in mind in case others report similar problems.

    • This reply was modified 5 years, 1 month ago by Andy Giesler.



Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal memory error under PHP 7’ is closed to new replies.