Plugin install causing Fatal Error

Hi guys,

Over the last few months when we install or update various plugins on our site we get this error every time and our site goes down.

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

It is for this site:

We fix it by going in a renaming the plugin we just installed, breaking the plugin and then removing or deactivating it.

The plugins that cause it have been Membership, Buddypress and other ones, it doesn't seem to be one plugin that causes the issue. Is there anything in the core code that is causing the error at all? We are having trouble installing new plugins because of it.

Many thanks in advance for your help

  • Predrag Dubajic
    • Support

    Hey @Adam Wallis,

    Hope you're doing well today :slight_smile:

    This looks like a memory limit causing the issue with the installation.
    You can try increasing memory size in your wp-config.php file by adding this code:
    define( 'WP_MEMORY_LIMIT', '512M' );
    Or in .htaccess file with this:
    php_value memory_limit 512M
    Or if you have access to your php.ini file to change memory limit by editing:
    memory_limit = 512M
    If this doesn't work and you can't access your php.ini file I suggest contacting your hosting provider with this issue, they should be able to change the php.ini file and fix this.

    Best regards,

  • Adam Wallis
    • Site Builder, Child of Zeus

    Hi Predrag,

    Thank you very much for your detailed reply. When we spoke to our hosting provider they said our memory limit was ok but we haven't tried changing the code in the files you suggested.

    I'm not too familiar with how and where to add the code you are talking about, could you explain how I make the changes you mentioned above please? Or we have granted support access if it's possible for you to add them yourself?

    Thanks again Predrag!

  • Predrag Dubajic
    • Support

    Hey @Adam Wallis,

    Sorry for the delay here.

    These can't be added via admin section so you would need to add them yourself using FTP access.
    If the memory limit is fine in php.ini file you should be good, but here is how to make the other changes just in case:
    wp-confing.php file is located in main folder of your WordPress installation on your server, in that file search for WP_MEMORY_LIMIT and change its limit if it's there or add the line from my first comment somewhere around lines 36/37.

    As for the .htaccess file change, this file is also located in main WP installation folder, just add the code to the end of your file.

    Did you check with your host if you have any server side caching enabled that can be causing this?

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.