• Resolved krmarshall87

    (@krmarshall87)


    I am seeing this error in the log constantly and have replaced the plugin, disabling it until resolved. I do not have access to the local server and cannot provide a code snippet of the offending lines. I am running the latest Wordfence version (6.3.22).

    PHP Fatal error: Call to undefined function file_exists() in C:\...\wordfence-waf.php on line 4

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,
    I can tell you are running Wordfence on Windows server which is not something we officially support as mentioned in the plugin requirements page, however I have never seen this issue before and I wonder which PHP version are you running?

    Thanks.

    Thread Starter krmarshall87

    (@krmarshall87)

    Unfortunately the answer to this questions I have no control over, but 5.4.45. Reading your requirements page, I do see you recommend 5.6. I have requested my host to upgrade, but they are a small company and have a hundred other sites that they host and are hesitant to upgrade- somewhat understandably, but that what a test environment is for..

    I have re-enabled Wordfence. I have noticed just toggling it resolved another issue I had with the redirect after admin login (had 500’d rather than 302). Since it is a FATAL error, I guess I will see if it crashes the site in the next month or so. That is about the frequency- only recently got access to the PHP log to troubleshoot.

    Is file_exists() a newer WordPress function? I know some plugins have had to make backward compatibility changes for 5.4 about a month ago.

    Or a better question, since I don’t have access to the root dir of the site install, what is the case that the plugin would enter this section of code so that I can attempt to prevent it.

    Thank you for your help!

    Hi,
    Sorry for my late reply, actually, “file_exists” is a PHP function that was introduced since PHP 4, so I have no idea why it reports “undefined function” while you are using PHP 5.4.45!

    Answering your second question, the file “wordfence-waf.php” is directly related to the firewall, and it will be generated if the firewall is optimized, so if you want to get rid of this file, you can follow the “Remove Extended Protection” procedure.

    I want also to suggest disabling all other installed plugins except Wordfence then re-checking this issue as it could be due to a plugin conflict.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Fatal error: undefined function file_exists() in wordfence-waf.php’ is closed to new replies.