• Resolved databell96

    (@databell96)


    I just updated PHP from 7.4 to 8.2.23 on SiteGround and I got the unfortunate WSOD. After doing the usual turning off plugins and switching themes, I was surprised to find out that WordFence, which is up to date, was the culprit. So the site is live but WF isn’t at the moment

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

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

    (@wfpeter)

    Hi @databell96, thanks for getting in touch about this!

    The white screen suggests a 500 error, or at least a fatal error somewhere in the loading process. Do you know precisely what this was from your server/PHP logs so we can see the potential cause from a file/function that Wordfence is trying to use?

    Generally, even though most customers choosing to use PHP8 are able to do so without issue, there may be some extra considerations. Firstly, does the site work when adjusting the version of PHP running on your site to a slightly different build of PHP8? If not, I have seen some customers with functions required by WordPress/Wordfence disabled by default when changing PHP version. You can usually pick PHP libraries/modules in the same area you choose your PHP version if the error you see in your logs is related to a missing/disabled function.

    Let us know what you find out!
    Peter.

    Hi @databell96,

    Allow me to help.

    I am using both SiteGround PHP 8.4.0 and Wordfence 7.11.7 (both latest versions) with no issues.

    Try the following:

    1. Temporarily downgrade to SiteGround PHP 7.4.33
    2. Clear all cache (theme, plugins, SG’s Dynamic Cache and Memcached, CDN, and browser) then close your browser.
    3. Launch your browser in incognito or private mode and visit your site.
    4. Verify your site is once again working with no issues. If yes, continue. If not, you may have a conflict with another plugin.
    5. Log into your site and enable Wordfence WAF (Learning Mode).
    6. Log out of your site.
    7. Upgrade to SiteGround PHP 8.0.30, wait 30 seconds, then visit your site. If no issues, then continue to upgrade to a higher PHP level up to PHP 8.4.0. One step at a time.
    8. Once you reach SiteGround PHP 8.4.0 with no issues, you’re good to go.

    Note: If for some reason, Step 7 or 8 give you an issue, either you have a plugin conflict or your htaccess file is corrupt. If your htaccess file is corrupt, to keep things simple, perform a clean uninstall of Wordfence, then verify the htaccess rule provided below is not present. If present, delete it, then reinstall Wordfence and activate WAF (learning mode).

    # BEGIN Wordfence WAF
    <IfModule mod_php5.c>
    php_value auto_prepend_file '/home/customer/www/omniaaerospace.com/public_html/wordfence-waf.php'
    </IfModule>
    <IfModule mod_php7.c>
    php_value auto_prepend_file '/home/customer/www/omniaaerospace.com/public_html/wordfence-waf.php'
    </IfModule>
    <IfModule mod_php.c>
    php_value auto_prepend_file '/home/customer/www/omniaaerospace.com/public_html/wordfence-waf.php'
    </IfModule>
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>
    # END Wordfence WAF

    As a last resort, contact SiteGround Support (via chat or ticket) for assistance.

    Hope this helps.

    Cheers!

    Note: Your website (not ours, obviously) will be reflected in the above htaccess rule. Cheers!

    Thread Starter databell96

    (@databell96)

    So downgrading back to 7.4 worked, but then upgrading to PHP 8.0.30 did not. This is what was in the logs:

    [05-Sep-2024 18:20:22 UTC] PHP Fatal error: Uncaught Error: Undefined constant “WFWAF_LOG_PATH” in /home/customer/www/welcomeyouhome.com/public_html/wordfence-waf.php:3
    Stack trace: 0 {main}

    thrown in /home/customer/www/welcomeyouhome.com/public_html/wordfence-waf.php on line 3
    [05-Sep-2024 18:20:22 UTC] PHP Fatal error: Uncaught Error: Undefined constant “WFWAF_LOG_PATH” in /home/customer/www/welcomeyouhome.com/public_html/wordfence-waf.php:3
    Stack trace: 0 {main}

    thrown in /home/customer/www/welcomeyouhome.com/public_html/wordfence-waf.php on line 3

    So definitely something up with the WAF in Wordfence.

    I then went to .htaccess and pasted in the new code that generosus suggested. Saved that and still getting WSOD. Went back to the logs and still seeing the same errors as before.

    The htaccess rule is self-generated by Wordfence. No need to paste anything into your htaccess file. Did you follow the suggested steps (one by one)?

    Thread Starter databell96

    (@databell96)

    Problem solved. Had to delete the wordfence-waf.php file from public_html and that fixed it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.