• I’m really struggling to get scans to complete and have seemingly exhausted all options. My current WordPress / PHP config is below:

    WordPress 4.9.5
    PHP 7.0.29
    memory_limit 512M
    max_execution_time 120
    post_max_size 256M

    In light of the problems I’ve been facing, I currently have the below WordFence settings applied:

    Scan Type: Limited Scan
    Use low resource scanning: Enabled
    Time limit that a scan can run in seconds: blank / default
    How much memory should Wordfence request when scanning: 256M
    Maximum execution time for each scan stage: 96
    Enable SSL Verification: Disabled

    I also have a plugin installed that displays current memory in use by the site, which settles down at around 46MB (9%). The memory available to the WordPress installation is 512MB – it was upgraded to this level by my host after requesting additional resources. They have told me that this is the maximum level that they can increase it to.

    Even with the above settings configured as they are (based on WordFence support article / forum advice, I still can’t seem to get a scan to complete. At the same stage each time (“Analyzed 7317 files containing 108.58 MB of data.”), I receive one of two errors:

    Fatal error: Out of memory (allocated 60817408) (tried to allocate 1056768 bytes) in /path/to/file/cURL.php on line 484

    or

    Scan terminated with error: There was an error connecting to the Wordfence scanning servers: cURL error 28: connect() timed out!

    I’m at a loss with what to do next. It seems I have sufficient memory available and configured appropriately, but the scans always fail. I’m close to throwing in the towel and trying All In One WP Security and Firewall instead, but I don’t really want to have to do this as I really like WordFence. Any advice would be very much appreciated.

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • I am getting exactly the same issue.
    The scan always worked. The problems started an hour ago.
    Maybe a problem with the wordfence servers?

    I already contacted my web server provider and the told me the problem would possibly on Wordfences end:
    “Logs shows we successfully connected to Wordfence API – though, the error shows it is timing out. Could be that Wordfence have rate limited the domain connection to their servers. Most likely because you are using a free account ? (just not sure) Much better if you can relay this concern to wordfence support.”

    • This reply was modified 6 years, 11 months ago by andfos.
    Thread Starter djvenja

    (@djvenja)

    Have run another scan this morning which has failed without any specific error, except for:

    “Scan Failed
    The current scan looks like it has failed. Its last status update was 14 mins ago. You may continue to wait in case it resumes or stop and restart the scan. Some sites may need adjustments to run scans reliably.”

    Have checked the full log, but this also shows no further errors. It stopped mid-analysis this time:

    [Apr 27 08:45:52:1524815152.772402:2:info] Analyzed 4100 files containing 71.29 MB of data so far

    Hello Mishash,

    Thank you for your reply.
    Unfortionally after following the article, I still can’t seem to get Wordfence working again. I updated the memory etc.

    Unfortionally I only have 500+ MB RAM Memory that I can dedicate to Wordfence.

    Did something change since the last update to Wordfence?
    I personally updated the plugin yesterday, from that moment the scans won’t work anymore.

    @djvenja Could you manage to get Wordfence working again?

    Thread Starter djvenja

    (@djvenja)

    @mishash – no, I still can’t scan. I’m not getting any more memory errors, just timeouts now. Have enabled debugging, but I’m not really getting any extra info (as far as I can see). With debugging enabled, the last scan timed out with the following info:

    [Apr 29 23:36:11:1525041371.976361:4:info] Scanning: /path/to/file/wp-content/plugins/updraftplus/methods/ftp.php (Mem:52.0M)[Apr 29 23:36:12:1525041372.000090:4:info] Calling fork() from wordfenceHash with maxExecTime: 96
    [Apr 29 23:36:12:1525041372.000872:4:info] Entered fork()

    Thread Starter djvenja

    (@djvenja)

    I’ve updated four plugins and now I’m getting memory errors again, quite early in the process now (around about 4700 files into analysis). I’m going to give this a few more days while I await further support and will replace WordFence with a different security plugin if I am unable to overcome these errors by Wednesday.

    Thread Starter djvenja

    (@djvenja)

    I’ve finally got a scan to complete. I discovered the WordFence memory testing tool on the Tools > Diagnostics tab. The tests show I can only request up to 70MB of memory, after which the tests fail. This is unusual as the System Config page (also accessed via the Diagnostics tab) and my memory status plugin both show that the Server and WordPress have 512MB available (I have defined the WordPress level in the wp-config file), so not sure where and why memory is being limited

    Event though scans are now completing, I’ve had to further tone down the scan options otherwise the scan always times out (no more memory errors, though). I have set “How much memory should Wordfence request when scanning” to 25MB and have unchecked both “Scan file contents for backdoors, trojans and suspicious code” and “Scan file contents for malicious URLs”. Re-enabling either of these options causes the scan to time out again, even if the memory made available is increased to 60MB/70MB.

    This isn’t ideal, but it’s better than no scan completing at all. I’ve no idea why memory is being limited to around 70MB as all settings and performance checks suggest that 512MB is available – can anyone suggest why I’m seeing memory tests fail at such a low level, yet all figures point to 512MB being avaiable?

    Hi @djvenja

    It’s recommended to assign “256” MB in “How much memory should Wordfence request when scanning“, Wordfence will not use all this amount, it will just ask PHP to increase the memory limit to whatever you specify so that in case Wordfence does use that amount of memory, PHP will only throw an error if the new maximum you have requested is reached. Setting this value to “25” MB is considered very low for regular sites.

    Are you sill having the cURL error?

    Thanks.

    Thread Starter djvenja

    (@djvenja)

    Hi @wfalaa

    Thanks for getting back to me. As mentioned in my last post, there is some confusion over the amount of memory available to WordPress as I seem to be seeing conflicting information. My host (123-Reg) have confirmed that they have assigned 512MB to my hosting platform, I have defined 512MB in wp-config.php, and this figure is reflected in my memory status plugin (which shows “Server: 512MB, WordPress: 512MB”) and any server status / PHP info pages and plugins.

    However, when I set the memory available to WordFence to anything higher than around 70MB, the WordFence memory test always fails with a memory error. With the memory set at 70MB or less, the test will pass and my scan will complete, but only with both “Scan file contents for backdoors, trojans and suspicious code” and “Scan file contents for malicious URLs” disabled.

    If I run a scan with a value higher than 70MB (I have mainly used values between 250-350MB, the scan will always fail, either with a timeout or memory error.

    The main problem here seems to be how much memory WordFence believes is assigned to WordPress. All plugins and status pages state that there is 512MB available to the server (with around 9% / 49MB in use under normal circumstances), but the WordFence memory test will fail if more than 70MB is set against “How much memory should Wordfence request when scanning”.

    Hi @djvenja

    Please go to (Wordfence > Tools => Diagnostics) and click on “Send Report by Email” button at the top of the page, you can send the report to “alaa [at] wordfence [dot] com”, make sure to include your forum username, I will take a look at this report and let you know my findings.

    Thanks.

    Thread Starter djvenja

    (@djvenja)

    Hi @wfalaa

    I have sent the report as requested (username included).

    Thread Starter djvenja

    (@djvenja)

    Hi @wfalaa – what did you manage to determine from the report I sent to you?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Scans never complete – memory and timeout errors’ is closed to new replies.