• Resolved +ES

    (@evelynmsdesigngraphicscom)


    Hi+
    I was chatting with my Hosting Provider about a different issue and he pointed out a “fatal PHP error for WordFence” on the site and told me to reach out to you for guidance/advice on what to do. Here is the full message I got from him:

    PHP Warning:
    fopen(/nas/content/live/*name*/wp-content/wflogs/rules.php): failed to openstream: No such file or directory in
    /nas/content/live/*name*/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/scr/lib/waf.php on line 332

    Please Note: I removed the website’s name from the string and replaced it with *name*
    If you need me to re-send that with the website’s name in it, then please let me know.

    Please help me understand what this PHP Warning is talking about and, if possible, provide a bit of guidance on what steps I need to take to fix that?
    Thank you, +ES

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfpeter

    (@wfpeter)

    Hi @evelynmsdesigngraphicscom,

    PHP warnings are non-fatal, so I’m not sure whether they’ve pasted the wrong error string to you. Running Query Monitor tends to display warnings like this for silent failures as we sometimes utilize WordPress’ $wpdb->suppress_errors(true); function in situations we know an error may occur. Query Manager however ignores this intentional error suppression inbuilt into WordPress and presents them as issues.

    It looks to me like rules.php was unavailable for opening at some point. You can check whether this is now rectified by visiting the wp-content/wflogs folder using your hosting file manager or FTP. You should be able to delete the wflogs folder or its contents entirely and Wordfence should try to repopulate it within 30 minutes. It’s also worth checking that in addition to 755 permissions on your WordPress site’s directories, the process owner is also www-data.

    If you have persistent problems with this file/folder but don’t see connectivity or permissions failures/error messages in your Wordfence > Tools > Diagnostics page, you can bypass this entirely by setting Wordfence to write to the MySQLi storage engine instead of a file: https://www.wordfence.com/help/firewall/mysqli-storage-engine/

    Thanks,

    Peter.

    Thread Starter +ES

    (@evelynmsdesigngraphicscom)

    Hi+
    Thank you @wfpeter for clarifying what is happening. I will give your suggestions a try and see how that goes. I will also reach back out to my hosting provider and find out if they are still seeing that error. I will post an update here after I do all of that.
    Thanks, +ES

    Thread Starter +ES

    (@evelynmsdesigngraphicscom)

    Hi+ @wfpeter

    I deleted the wflogs via SFTP and they did re-populate as expected. Then I reached out to the Hosting and they now see the following:

    Checking the backend — seeing the php warnings: PHP Warning: fopen(/nas/content/live/cosanusa/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /nas/content/live/cosanusa/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332

    They state that it is the same issue (but no longer a ‘fatal error’) and told me to reach back out to you… And, here I am – my apologies for not having a clear understanding on this issue. Is this something I need to take additional steps on? If so, please provide additional guidance.

    Also, I’m not sure where to find the www-data (via SFTP?) to verify that it does have the 755 permissions that you indicated. Can you please provide a bit more guidance on that? (And, I will confirm it.)

    Thank you, +ES

    Plugin Support wfpeter

    (@wfpeter)

    Hi @evelynmsdesigngraphicscom,

    There’s a helpful page here that might help you with permissions and owners: https://www.freecodecamp.org/news/linux-chmod-chown-change-file-permissions/, specifically the screenshot: https://www.freecodecamp.org/news/content/images/size/w1000/2022/04/image-158.png that explains how to check the owner and mode.

    You may be able to see read/write permissions and owners from your hosting provider’s File Manager though, so may not need to get involved with the command line at all.

    If you’re uncomfortable changing these (if they need to be), I’m sure your host can ensure you don’t change anything wrongly or can point you in the right direction on changing them using their in-browser tools.

    Thanks,

    Peter.

    Thread Starter +ES

    (@evelynmsdesigngraphicscom)

    Hi @wfpeter,

    Thank you for the guidance and links for the permissions. I will review those.

    Please let me know if there is anything else I should do regarding that PHP Warning?

    Thank you, +ES

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal PHP Error Notice Received – please advise’ is closed to new replies.