I am using nginx with php-fpm, and we are receiving a lot of errors like this:
2022/01/23 12:48:13 [error] 5514#5514: *9277 FastCGI sent in stderr: "PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/vhosts/evtm.dev.nick/wp-content/db.php) is not within the allowed path(s): (/var/www/vhosts/evtm.dev.nick/:/usr/lib/php/:/tmp/:/data/sucuri:/var/www/prepend/) in /var/www/vhosts/evtm.dev.nick/wp-includes/load.php on line 545" while reading response header from upstream, client: 10.0.2.33, server: dev-nick.evtm.com, request: "POST /?wc-ajax=get_refreshed_fragments HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "dev-nick.evtm.com", referrer: "https://dev-nick.evtm.com/"
It is saying that the file /var/www/vhosts/evtm.dev.nick/wp-content/db.php
is not within the allowed path of /var/www/vhosts/evtm.dev.nick
- when it clearly appears to be.
Is there something preventing it from working recursively?
The issue was a
symlink
filedb.php
. This was copied from another folder on another instance, and the symlink was pointing to that original file.Unlinking the file and linking to the correct one resolved the issue.