Welcome to Centmin Mod Community
Become a Member

Nginx Redis "open_basedir restriction in effect"

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by jcat, Apr 20, 2016.

  1. jcat

    jcat Member

    153
    22
    18
    Jun 21, 2015
    New Jersey
    Ratings:
    +64
    Local Time:
    2:19 AM
    Anyone having this issue, its affecting multiple servers.

    If we are hosting multiple WP sites on single server and one or more are using Redis cache, we constantly see:

    Code:
    PHP message: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/home/nginx/domains/domain1.com/public/wp-content/languages) is not within the allowed path(s): (/home/nginx/domains/domain2.com/public/:/usr/local/lib/php/:/tmp/) in /home/nginx/domains/domain1.com/public/wp-includes/load.php on line 324
    
    PHP message: PHP Warning:  file_exists(): open_basedir restriction in effect. File(/home/nginx/domains/domain1.com/public/wp-content/db.php) is not within the allowed path(s): (/home/nginx/domains/domain2.com/public/:/usr/local/lib/php/:/tmp/) in /home/nginx/domains/domain1.com/public/wp-includes/load.php on line 365
    There are many other directories and files involved but this is just to give you an idea. I've ensured that the installs do not actually access files from other installs.

    We even see this where 1 site is using Redis and the other site(s) are not, still happens. I was thinking if multiple sites were using Redis cache and the same redis db was being used they were using each others cache which makes sense but in the case where only 1 site is using Redis and the others are not, has be stumped.

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,927
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    4:19 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    might need to disable open_basedir restrictions globally in /usr/local/nginx/conf/php.conf and restart nginx and php-fpm and see
     
  3. jcat

    jcat Member

    153
    22
    18
    Jun 21, 2015
    New Jersey
    Ratings:
    +64
    Local Time:
    2:19 AM
    Yeah I have and that is the only way to fix it, but would allow one of the sites the ability to infect the other sites. I'm more interested in why one site is trying to access others, this is on multiple servers running redis, most likely because open_basedir is enabled by default, so was curious if anyone else was running into it new what was causing it.