• Just to make sure this is noticed, I’m posting it separately.

    If you are running Wordfence 5.3.6 and you are getting an error “You are using an Nginx web server and using a FastCGI processor like PHP5-FPM” even though you are using Apache server with PHP-FPM, here’s how you can get this fixed (I hope this is fixed in newer versions)

    The problem is that WF assumes that it’s enough to have $sapi == ‘fpm-fcgi’ to consider server running nginx. Which is a wrong assumption, because you can run fpm-fcgi with apache just as well. And that’s exactly what I’m running. It could be also a bug in the code (hence, the assumption, because it also checks $_SERVER[‘SERVER_SOFTWARE’] as an extra test).

    So here’s what you need to do to fix it:

    1. Open wp-content/plugins/wordfence/lib/wfUtils.php
    2. Go to line 615
    3. Replace “||” with “&&”

    Here’s the code that you are going to be altering for the reference:

    public static function isNginx(){
                    $sapi = php_sapi_name();
                    $serverSoft = $_SERVER['SERVER_SOFTWARE'];
                    if($sapi == 'fpm-fcgi' || stripos($serverSoft, 'nginx') !== false){
                            return true;
                    }

    What you’re doing is changing the test so that it requires that both sapi equals fpm-fcgi AND server software says nginx rather than one or the other being sufficient evidence for server to be running nginx.

    https://ww.wp.xz.cn/plugins/wordfence/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Apache not identified properly’ is closed to new replies.