I get a PHP Fatal Error in my Error Log

Hi, I just checked the error log on my webhost and I found a long list of this errors repeating. It seems to happen every day. I wonder if you guys have any idea what is causing it or how can to fix it?

Errors:
[07-Jan-2018 13:36:32 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1048576 bytes) in .../wp-content/plugins/wp-defender/vendor/php_codesniffer/CodeSniffer/Tokenizers/PHP.php on line 1145

[05-Jan-2018 01:20:14 UTC] PHP Warning: posix_getpwuid() has been disabled for security reasons in .../wp-admin/includes/class-wp-filesystem-direct.php on line 199

Many Thanks!

  • James Morris

    Hello Silviu,

    I hope you are well today.

    PHP Fatal error: Allowed memory size of 134217728 bytes exhausted

    This first error is extremely common. By default, most web hosts only configure PHP with the minimum allowed memory for your site. This is so they can host more sites on less resources. However, some plugins require a bit more and that's when you'll commonly see this error.

    Looking at this error, it looks like you're only allocated about 134MB of memory. You can try adjusting this yourself by adding the following to your wp-config.php

    // Performance Enhancements
    ini_set("memory_limit","256M");
    ini_set("max_execution_time","180");
    // Increase WP Memory Limit
    define('WP_MEMORY_LIMIT', '256M');

    Please note: Not all web hosts support such enhancements. If this does not resolve your problem, you may need to contact your host about upgrading your PHP memory_limit allowance.

    PHP Warning: posix_getpwuid() has been disabled for security reasons in

    What this second Warning is saying is that your web host has disabled the native posix_getpwuid() PHP function. Since this function returns info about a user by user id, this is actually a good security enhancement. This will not cause you any problems unless you are using a plugin or custom code that makes use of the posix_getpwuid() native function. In the case that you are, such code will not run and will throw a fatal error.

    I hope this clarifies a bit. Let us know if you have any further questions. We'll be happy to help! :slight_smile:

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.