• Hi team,

    We have successfully activated WordFence in our dev/test/live sites using our server pantheon’s documentation – https://pantheon.io/docs/plugins-known-issues/#wordfence

    Now seen below errors in all env. https://prnt.sc/7Lp90X6Q3b4K

    [10-Feb-2023 12:42:03 UTC] PHP Warning: fopen(/code/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /code/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332


    [10-Feb-2023 12:42:03 UTC] PHP Warning: include(/code/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /code/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 335

    Once i seen this in TEST env, I ignored it because that is the warning we can safely ignore as per pantheon’s documentation –?https://prnt.sc/FR1cOrphLbKQ

    Now i am curious about this error in production. Do we need to do anything?

    Kindly assist, because this is in production.

    Our PROD URL – https://statueofliberty.org/

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

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

    (@wfpeter)

    Hi @hemasusi, thanks for reaching out to us.

    Your screenshots are showing as broken images when the page loads for me but I think I can help you out from the information I have.

    We do tend to suppress “expected” errors where a file is not found or a race condition occurs where two calls attempt to do the same thing at the same time. However, we have noticed that tools like Query Manager ignore the $wpdb->suppress_errors(true); function provided by WordPress. Do you also have this installed or is this from your regular server log files?

    The reason why we will allow some non-fatal warnings such as this to happen is because it takes more resources to check for the presence of a file rather than just attempt to perform an operation and ignore the error if it’s not there.

    If you’re also experiencing other problems with rules updates, or wish to see whether this warning can be removed, it’s possible to bypass wflogs files entirely by telling Wordfence to write to the MySQLi storage engine instead: https://www.wordfence.com/help/firewall/mysqli-storage-engine/

    Thanks,
    Peter.

    Thread Starter hemasusi

    (@hemasusi)

    Hi @wfpeter

    In my First Screenshot – I attached the continues errors lines in the error log file from our Production.

    In second screenshot – i have sow you how patheon team describe about the mentioned warning in their documentation. You can also see this in this link – https://pantheon.io/docs/plugins-known-issues/#wordfence (In that, please check 10th Step, they listed the warning errors and mentioned as “You can safely ignore the warning messages”)

    We have not intalled Query Manager. The error messages logged every date in our server php error log file.

    So for this no such files rules.php, i need to add define('WFWAF_STORAGE_ENGINE', 'mysqli'); in wordfence-waf.php ? or can ingore?

    Thread Starter hemasusi

    (@hemasusi)

    Hi?@wfpeter

    I am waiting for your response.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @hemasusi,

    If you wish to move to the MySQLi storage engine, yes you’ll need to add the line to the wordfence-waf.php file, after the opening PHP tag, but before any other code appears.

    Let me know how you get on!
    Peter.

    Thread Starter hemasusi

    (@hemasusi)

    Hi @wfpeter

    If you wish” – So no need to do anything for the rules.php error?

    or the MySQLi storage engine is must to solve the error in log file?

    Kindly reply.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @hemasusi, my apologies if that was confusing.

    The MySQLi storage engine is an optional alternative to using files (including rules.php), so “if you wish” was based on if you wanted to optionally bypass the warning you’re seeing by enabling the MySQLi storage engine instead.

    Many thanks,
    Peter.

    Thread Starter hemasusi

    (@hemasusi)

    Hi?@wfpeter,

    So apart from this, i can ignore the error ‘[10-Feb-2023 12:42:03 UTC] PHP Warning: fopen(/code/wp-content/wflogs/rules.php): failed to open stream: No such file or directory in /code/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/waf.php on line 332’ …

    This will not create any impact/issue right?

    To solve the error, there is an option to go for MySQLi storage engine… But its not mandatory? So we can ignore the warning errors?

    Thread Starter hemasusi

    (@hemasusi)

    HI @wfpeter

    Kindly check my last message and this.

    In WF Diagnostics page seeing like – https://prnt.sc/PHHIrYrpSJ7Z

    What should do to solve this ?

    Please answer.

    Thank you.

    Thread Starter hemasusi

    (@hemasusi)

    Hi @wfpeter

    Note : We are already using MySQLi storage engine. (found in Tools > Diagnostics > WordFence Firewall > Active Storage Engine)

    https://prnt.sc/6tggbTfXGIS2

    Thread Starter hemasusi

    (@hemasusi)

    Hi Team,

    I am waiting for yur response. Kindly help us.

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Failed to open stream rules.php’ is closed to new replies.