• Resolved ilicmac

    (@ilicmac)


    Hello,

    I am managing a site under version control and manually upgraded Wordfence to v7.9.2. The site is running on a server with nginx and WordPress v6.1.1.

    I am getting the below error:

    The Wordfence Web Application Firewall cannot run. The configuration files are corrupt or inaccessible by the web server, which is preventing the WAF from functioning. Please verify the web server has permission to access the configuration files. You may also try to rebuild the configuration file by clicking here. It will automatically resume normal operation when it is fixed.

    Attempting to rebuild the configuration files as instructed above gives the following error:

    We were unable to write to ~/wp-content/wflogs/ which the WAF uses for storage. Please update permissions on the parent directory so the web server can write to it.

    I do not have a wflogs directory inside wp-content , or anywhere else. Nor do I have a wordfence-waf.php file. wp-contenthas 775 file permissions, which I would expect to be sufficient.

    Wordfence Diagnostics flagged that the server cannot write to?~/plugins/wordfence?and that there are no files readable or writeable in?~/wp-content/wflogs.

    What I have tried:

    1. Manually creating a wflogs directory – no effect
    2. Uninstalling Wordfence completely by deleting all associated files and reinstalling manually – no effect

    Users are regularly being locked out of the site by Wordfence and I am having to manually disable the plugin each time.

    Any suggestions for what I can try would be greatly appreciated.

    Tamara

    • This topic was modified 1 year, 7 months ago by ilicmac.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfjanet

    (@wfjanet)

    Hi @ilicmac,

    Thank you for reaching out to us.

    This issue normally occurs when  Wordfence has an issue writing data to the wflogs folder. This can be caused by corrupt files or the hosting environment has run out of allowed space or the file is not available/permitted to be written to. I suspect it is a permission issue in your case.

    Permissions should be set to 755 for the WordPress site’s directories – this includes the wp-content and wflogs folders, and the process owner should be set to www-data if needed for your setup.

    If the issue persists, you can bypass the need to write to these files entirely by setting Wordfence to use the MySQLi storage engine instead: 

    https://www.wordfence.com/help/firewall/mysqli-storage-engine/

    https://www.wordfence.com/help/firewall/mysqli-storage-engine/

    Please get back to us in case the above doesn’t solve your issue.

    Thanks,

    Janet.

    Thread Starter ilicmac

    (@ilicmac)

    Hi Janet,

    Thank you for getting back to me – appreciate your time.

    The permissions for the WordPress site’s directories are already 775, which grants greater access than 755. I don’t believe downgrading would make a difference but please do let me know if you disagree.?

    I don’t have a wflogs folder at all to check its permissions.??

    Process owner is www-data for all existing WordPress directories.

    Thank you for suggesting I switch to using the MySQLi storage engine instead. Not sure if I did something wrong but the issue hasn’t been resolved. I defined WFWAF_STORAGE_ENGINE?in wp-config.php above the “/* That’s all, stop editing! Happy blogging. */ ” line as instructed and updated the file paths.

    I didn’t have an existing wordfence-waf.php file so I created one. You can see its entire contents in the screenshot below:

    Diagnostics report before setting Wordfence to use MySQLi:

    Diagnostics report after setting Wordfence to use MySQLi:

    The only difference is that the red ‘X’ has disappeared from the wflogs related tests. Not sure if that means anything? I have sent a report by email so hopefully you / your team can take a look. 

    Thank you for your energy and patience.

    Tamara

    Plugin Support wfjanet

    (@wfjanet)

    Hi @ilicmac,

    Thank you for getting back to us. 

    The wordfence-waf.php file and /wflogs directories? should be created automatically. Please delete the files and directories you created manually and try the following. Let me know if it makes a difference:

    Check the option to  “Delete Wordfence tables and data on deactivation” in the General Wordfence Options section of the Wordfence Dashboard > Global Options page, deactivate the Wordfence plugin, delete it, and reinstall it.

    I can’t find your diagnostic report.

    Please try the below instead:

    Navigate to Wordfence > Tools > Diagnostic page and then click the “Export” button. Send the txt file to [email protected]. Add your forum username in the subject and respond here once done.

    Thanks,

    Janet

    Thread Starter ilicmac

    (@ilicmac)

    Hi Janet,

    Apologies for the slight delay. I was struggling to deactivate the plugin as the site had extended protection enabled manually. I couldn’t locate any of the relevant files to remove the extended protection. I eventually managed with the help of Wordfence Assistant, which allowed me to “remove all Wordfence data in the database and elsewhere”.

    I have now reinstalled Wordfence and sent the diagnostics report by email.

    Look forward to hearing from you.

    Tamara

    Plugin Support wfjanet

    (@wfjanet)

    Hi @ilicmac,

    Sorry I took a while to get back to you.

    Where is your site hosted?

    From the diagnostic report, Wordfence still doesn’t have write to ~/plugins/wordfence access. If the permissions are set to 775, I would suggest reaching out to your hosting provider so that they can advise on this issue.

    Let me know once you hear from them.

    Thanks,

    Janet.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Missing ‘wflogs’ directory’ is closed to new replies.