• Resolved pizzapie79

    (@pizzapie79)


    Hi, I’m trying to use wordfence scan but I get the following error: “Warning: scandir(/var/www/clients/client1/web292/web/): failed to open dir: Permission denied in /var/www/clients/client1/web292/web/wp-content/plugins/wordfence/lib/wfScanEngine.php on line 596”

    But wordfence is scanning the wrong filepath, cause my website path is now “/var/www/clients/client85/web89/web/”. I’ve moved my site to a new server, but wordfence is still pointing to old filepath.

    I’ve already tried to deactivate and reinstall wordfence, and I’ve already checked “Delete Wordfence tables and data on deactivation”.

    How can I set the right filepath in wordfence? Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support wfphil

    (@wfphil)

    Hello,

    It could be that the problem is that the file path is incorrect in either your htaccess file or .user.ini file in your document root.

    If you need any further assistance please don’t hesitate to ask.

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi, thank you for your answer. I’ve checked, and it seems fine…
    Here’s my htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # Wordfence WAF
    <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

    and my user.ini:

    ; Wordfence WAF
    auto_prepend_file = '/var/www/clients/client85/web89/web/wordfence-waf.php'
    ; END Wordfence WAF

    Any other idea?
    Thanks in advance!

    Plugin Support wfphil

    (@wfphil)

    Hello,

    It could be a possibility that the absolute path to the WordPress directory is incorrect in the config.php file in the following location on the new server:

    ~/wp-content/wflogs/config.php

    Using a text editor do a search for ABSPATH in the above config.php file and shortly after it will show you the absolute path. Check that it isn’t set to the path of your old server.

    Also it could be the case that you have an override for the absolute path for your old server in your wp-config.php file.

    Let us know how it goes.

    Thread Starter pizzapie79

    (@pizzapie79)

    Thankyou again, I’ve checked ~/wp-content/wflogs/config.php and I found:

    s:13:"pluginABSPATH";s:36:"/var/www/clients/client85/web89/web/";

    So it seems right…and I checked also wp-config.php file but I haven’t found any override.

    Any other suggestion? Thanks in advance!

    Plugin Support wfphil

    (@wfphil)

    Hello,

    Sorry for the delay in getting back to you. May I ask the process that you went through to migrate the website please?

    Here are some things that you can try to attempt to narrow down the cause. Enable debugging mode at the bottom of the Diagnostics tab on the Tools page and start another scan. Then go to the Scan page and to the right of the Scan Detailed Activity box can you click and send the activity to the email address that is pre-filled for you. Once we receive the email for the detailed activity for the scan it can help us to get more of an idea of what may be happening. In the meantime here are some other things to check.

    Can you check to see if you have any overrides pointing to the old server file path in the following files:

    index.php
    wp-blog-header.php
    wp-load.php

    The next thing to try is to add the code below to either your theme’s header of footer file (adding it to the top of the header file will help you to find the output easily when you get to the next stage).

    <?php echo '<!--ABSPATH='.ABSPATH.' CWD='.getcwd().'-->'; ?>

    Then load a page and look at the source code for that page and see what the file path is for the output of the code that you have added. Remember to remove the code afterwards from the theme file that you have added. If you need to use the search function on your browser just search for ABSPATH

    We want to see if the file path is correct and matches the file path on the new server. Please let us know the outcome.

    If the file path for the output above is for the new server can you check that the DNS records are correct for the website. If that all seems to be ok can you ask the hosting provider to check that /etc/hosts doesn’t contain your domain and the IP address of the old server?

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi,
    unfortunately the migration has been made by someone else, so I can’t tell you the process… however, I’ve checked the files you mentioned and I’ve found no override, also I checked ABSPATH in theme header.php file and the path is correct.

    So, I’ve just asked my hosting provider and I’m waiting for answer. I’ll let you know as soon as I get an answer.

    Again, thank you very much for your help ??

    Thread Starter pizzapie79

    (@pizzapie79)

    Hi,
    now it’s finally working!
    It was just a DNS cache problem and my hosting provider easily fixed it.
    Thank you VERY VERY much for your help, you are awesome ??

    Plugin Support wfphil

    (@wfphil)

    Hello,

    Awesome! Glad that we got to the bottom of the problem. Thank you for your kind words, and I have passed on your kind words to the team members that have also been looking into your problem.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Wordfence scan in the wrong filepath after moving’ is closed to new replies.