Hello everyone, I'm having very strange fatal PHP errors on a fresh install. Everything is working fine. However, when I migrated my website over, I'm getting all kinds of strange php errors related to a file that doesn't even exist anymore. Very strange. Here are the errors from the httpd logs: 2019/10/23 15:31:45 [error] 30900#30900: *820 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/srv/data/web/vhosts/myoldwebsite.com/htdocs/wordfence-waf.php) is not within the allowed path(s): (/var/www/clients/client4/web4/web:/var/www/clients/client4/web4/private:/var/www/clients/client4/web4/tmp:/var/www/myoldwebsite.com/web:/srv/www/myoldwebsite.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in Unknown on line 0 PHP message: PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 PHP message: PHP Fatal error: Unknown: Failed opening required '/srv/data/web/vhosts/myoldwebsite.com/htdocs/wordfence-waf.php' (include_path='.:/usr/share/php') in Unknown on line 0" while reading response header from upstream, client: XX.XX.XX.XX, server: myoldwebsite.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php7.2-fpm/web4.sock:", host: "myoldwebsite.com" As you can see, the error relates to wordfence-waf.php. This file does not exist, nor does the htdocs folder its looking for. Anyway, what should I try to fix this? I'm using PHP 7.2 FPM, nginx 1.14.0, and Ubuntu 18.04 LTS
Most likely the original installation path is still somewhere in the WordPress database. I would try to uninstall wordfence in your blog and then reinstall it.
Wordfence ties to the waf in php config, look for user.ini I think it is. You can just remove it and the wordfence-waf.php file, then login to the site and setup the firewall again to recreate them with the correct paths.
FWIW I just checked sites here running various versions of php-fpm and the file is actually .user.ini for all of them. Code: # cat /data/www/clients/client10/web22/web/.user.ini ; Wordfence WAF auto_prepend_file = '/var/www/clients/client10/web22/web/wordfence-waf.php' ; END Wordfence WAF So in this case you would run: Code: rm /data/www/clients/client10/web22/web/.user.ini /data/www/clients/client10/web22/web/wordfence-waf.php