• Resolved ProxxiM

    (@proxxim)


    Hi there,

    On one of my clients site WordFence isn’t finishing it’s scans anymore. The error message is like this:
    “[Oct 31 09:11:56:1509437516.664007:1:error] Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1048577 bytes) in /var/www/vhosts/hulponlineoost.nl/httpdocs/wp-content/plugins/wordfence/lib/wordfenceScanner.php on line 317”

    I’ve looked around the internet for a way to solve this problem. I came across various ways to enlarge the server memory. First I increased it to 256MB, but it still failed with the same error. According to my hosting partner this is the maximum PHP memory for this subscription plan. Still, I increased the memory to 512MB, but it failed anyway.

    Against all knowledge I even increased the memory to 1024MB and sure enough: the scan finished without errors! This surprised me, because as far as I know this amount of memory shouldn’t be available.

    As far as I know no new plugins or themes are installed. So, I’m wondering: how can it be that WordFence previously finished the scans with only 40MB available, and now it needs 1024MB? If there would be some kind of problem with the site, shouldn’t WordFence find it after completing a scan?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • wfalaa

    (@wfalaa)

    Hi,
    Is this error message persistent with the same numbers when trying to run a scan during the day?

    Also, are you trying to increase the memory limit in “How much memory should Wordfence request when scanning“?

    If you have “Scan images, binary, and other files as if they were executable” option enabled, try to disable it and run a new scan, also make sure “HIGH SENSITIVITY” isn’t enabled.

    Keep me updated,
    Thanks.

    Thread Starter ProxxiM

    (@proxxim)

    Hi wfalaa,

    Thanks for your comment!

    What do you mean by ‘persistent with the same numbers’ exactly? Do you mean the ‘Allowed memory size of 268435456 bytes exhausted (tried to allocate 1048577 bytes)’ or ‘on line 317’?
    Anyway, line 317 is always mentioned, the other numbers are dependent on the amount of memory that I made available.

    I came across the article to increase the memory limit and set it to 128MB. Disabling the options you mentioned doesn’t make WordFence finish the scanning process.

    wfalaa

    (@wfalaa)

    Yes, that’s what I meant.

    Was editing “wp-config.php” file or “php.ini” involved in the method you tried to increase the memory limit on your server?

    Also, what do you have for “How much memory should Wordfence request when scanning” option? and what about running the memory test in (Wordfence > Tools > Diagnostics)?

    Thanks.

    Thread Starter ProxxiM

    (@proxxim)

    Hi wfalaa,

    I’ve increased the available memory via the wp-config.php file.

    At the moment I’ve configured the ‘How much memory should Wordfence request when scanning’ at 128MB, WP_MEMORY_LIMIT in diognostics is at 1024MB. If I decrease WP_MEMORY_LIMIT to 728MB, the test fails.

    This is what the memory test says:

    Wordfence Memory benchmarking utility version 6.3.21.
    This utility tests if your WordPress host respects the maximum memory configured
    in their php.ini file, or if they are using other methods to limit your access to memory.
    
    --Starting test--
    Current maximum memory configured in php.ini: 1024M
    Current memory usage: 23.00M
    Attempting to set max memory to 128M.
    Starting memory benchmark. Seeing an error after this line is not unusual. Read the error carefully
    to determine how much memory your host allows. We have requested 128 megabytes.
    Tested up to 30.25 megabytes.
    Tested up to 35.25 megabytes.
    Tested up to 40.25 megabytes.
    Tested up to 45.25 megabytes.
    Tested up to 50.25 megabytes.
    Tested up to 55.25 megabytes.
    Tested up to 60.25 megabytes.
    Tested up to 65.25 megabytes.
    Tested up to 70.25 megabytes.
    Tested up to 75.25 megabytes.
    Tested up to 80.25 megabytes.
    Tested up to 85.25 megabytes.
    Tested up to 90.25 megabytes.
    Tested up to 95.25 megabytes.
    Tested up to 100.25 megabytes.
    Tested up to 105.25 megabytes.
    Tested up to 110.25 megabytes.
    Tested up to 115.25 megabytes.
    Tested up to 120.25 megabytes.
    Tested up to 125.25 megabytes.
    Tested up to 128.25 megabytes.
    --Test complete.--
    
    Your web host allows you to use at least 128.25 megabytes of memory for each PHP process hosting your WordPress site.
    wfalaa

    (@wfalaa)

    Try to set “How much memory should Wordfence request when scanning” to “256MB” and run a new scan then check the memory usage at the end of the scan.

    I think your server is “almost” running out of memory, so if it’s using 95% of memory right now, the 5% left isn’t enough to run the scan, it might be worth to check the server memory usage in general.

    Thanks.

    Thread Starter ProxxiM

    (@proxxim)

    Hi wfalaa,

    In your opinion, what should the setting in the wp-config.php file be if I set “How much memory should Wordfence request when scanning” to 256MB?

    wfalaa

    (@wfalaa)

    You shouldn’t exceed the maximum memory limit set by your hosting provider in wp-config.php, so I would say 256MB also.

    Thanks.

    Hello!

    I hope we were successful in helping you resolve your issue with Wordfence! Since we have not heard back from you in the past 2 weeks I will now be marking this support thread as resolved. However, if we still haven’t resolved your issue please reach out to us as we would be more than happy to further assist you!

    Thanks and have a great day!
    Chloe

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Error with wordfenceScanner.php’ is closed to new replies.