Learn about Centmin Mod LEMP Stack today
Register Now

Nginx Redis "open_basedir restriction in effect"

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

  1. jcat

    jcat Member

    51
    13
    8
    Jun 21, 2015
    Ratings:
    +20
    Local Time:
    8:25 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

    28,952
    6,572
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,753
    Local Time:
    10:25 PM
    Nginx 1.13.x
    MariaDB 5.5
    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

    51
    13
    8
    Jun 21, 2015
    Ratings:
    +20
    Local Time:
    8:25 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.