strange php openbasedir issue with reseller account

Discussion in 'Installation/Configuration' started by nhybgtvfr, Feb 25, 2016.

  1. nhybgtvfr

    nhybgtvfr Member

    i've been trying to copy some sites over to ispconfig servers, for final real-world traffic testing before making it all live and migrating all sites over.

    i've noticed some strange behaviour with a reseller account, where the reseller has several wordpress websites of his own.
    (no subclient accounts setup yet)
    all the sites on the ispconfig server are only accessible by adding the details to my local hosts file and to the servers host files. the public dns still points to the live sites currently on a plesk server.

    only the reseller's site whose vhost config file was most recently created appears to be working properly. the first page of the other sites is either blank, or appears to work ok, but clicking on any links (wordpress stubs) goes to a blank page.

    i don't believe it's anything inherent to wordpress, these same sites are working perfectly fine, all on the same plesk server.
    i have another client account configured on ispconfig, which also has multiple wordpress websites, and they currently working without any apparent issues.

    the reseller account has the id c5, one of the wordpress websites has the id web8, the other one web10.
    but looking through the logs, php is somehow mixing things up between them.

    note the bold underlined test in the log snippets.
    from web8 logs:
    [Thu Feb 25 14:45:11.315193 2016] [:error] [pid 27246] [client 84.45.154.103:56300] FastCGI: server "/var/www/clients/client5/web8/cgi-bin/php5-fcgi-*-80-webswonder.co.uk" stderr: PHP message: PHP Fatal error: Class 'Pimple\\Container' not found in /var/www/clients/client5/web8/web/wp-content/plugins/backupwordpress-pro-gdrive/backupwordpress-pro-gdrive.php on line 37, referer: http://www.webswonder.co.uk/
    [Thu Feb 25 14:45:19.820963 2016] [:error] [pid 27247] [client 84.45.154.103:56301] FastCGI: server "/var/www/clients/client5/web8/cgi-bin/php5-fcgi-*-80-webswonder.co.uk" stderr: PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client5/web10/web/wordpress/wp-content/plugins/backupwordpress-pro-gdrive/vendor/pimple/pimple/src/Pimple/Container.php) is not within the allowed path(s): (/var/www/clients/client5/web8/web:/var/www/clients/client5/web8/private:/var/www/clients/client5/web8/tmp:/var/www/webswonder.co.uk/web:/srv/www/webswonder.co.uk/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client5/web10/web/wordpress/wp-content/plugins/backupwordpress-pro-gdrive/vendor/composer/ClassLoader.php on line 383

    from web10 logs:
    [Thu Feb 25 14:50:51.999129 2016] [:error] [pid 27965] [client 84.45.154.103:56471] FastCGI: server "/var/www/clients/client5/web10/cgi-bin/php5-fcgi-*-80-newcastle-emlyn.com" stderr: PHP message: PHP Fatal error: Class 'Pimple\\Container' not found in /var/www/clients/client5/web10/web/wordpress/wp-content/plugins/backupwordpress-pro-gdrive/backupwordpress-pro-gdrive.php on line 37
    [Thu Feb 25 14:51:05.314310 2016] [:error] [pid 27969] [client 84.45.154.103:56475] FastCGI: server "/var/www/clients/client5/web10/cgi-bin/php5-fcgi-*-80-newcastle-emlyn.com" stderr: PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client5/web8/web/wp-content/plugins/backupwordpress-pro-gdrive/vendor/pimple/pimple/src/Pimple/Container.php) is not within the allowed path(s): (/var/www/clients/client5/web10/web:/var/www/clients/client5/web10/private:/var/www/clients/client5/web10/tmp:/var/www/newcastle-emlyn.com/web:/srv/www/newcastle-emlyn.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in /var/www/clients/client5/web8/web/wp-content/plugins/backupwordpress-pro-gdrive/vendor/composer/ClassLoader.php on line 383

    the automatically created, and unedited openbasedir settings in ispconfig are:
    web8:
    /var/www/clients/client5/web8/web:/var/www/clients/client5/web8/private:/var/www/clients/client5/web8/tmp:/var/www/webswonder.co.uk/web:/srv/www/webswonder.co.uk/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin

    web10:
    /var/www/clients/client5/web10/web:/var/www/clients/client5/web10/private:/var/www/clients/client5/web10/tmp:/var/www/newcastle-emlyn.com/web:/srv/www/newcastle-emlyn.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin

    server os: ubuntu 14.04.3 LTS
    PHP 5.6.18-1+deb.sury.org~trusty+1 (cli)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with XCache v3.2.0, Copyright (c) 2005-2014, by mOo
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with XCache Optimizer v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Cacher v3.2.0, Copyright (c) 2005-2014, by mOo
    with XCache Coverager v3.2.0, Copyright (c) 2005-2014, by mOo

    all the sites on the server are currently set to use the same php version, and all sites are set to use php-fpm

    anyone got any idea just what's going on here?

    thanks.
    lee.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do a full text search in the WordPress database of the affected site with PHPMyAdmin for "web8", most likely the old path is set somewhere in the database. If thats not the case, then do a full text search with grep in the web folder of web10 for the string web8.
     
  3. nhybgtvfr

    nhybgtvfr Member

    no instances of web10 anywhere in the web8 database or files, similarly no instances of web8 in the web10 database or files.

    which is what i expected, web8 and web10 aren't part of any old paths, these sites were copied over from a plesk server, the previous paths for these sites were
    /var/www/vhosts/<DOMAINNAME>/httpdocs/

    similarly httpdocs only appears once in the files and once in the database for each site on the ispconfig server.
    in /web(8/10)/web/wordpress/wp-includes/ID3/getid3.php, and even then it's only appears within a comment in this file.
    and in the database, in reference to an excluded directory for the backupwpwordpress plugin.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to deactivate php opcaches like xcache, maybe the cache mixes up the paths.
     
  5. nhybgtvfr

    nhybgtvfr Member

    ok got it.
    completely disabled the built-in opcache in php 5.6 in /etc/php5/fpm/php.ini which seems to have fixed it.
    XCache doesn't appear to suffer from the same problem.

    so now i just need to find out how to disable opcache on a per vhost basis, or find a fix for opcache.
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    till likes this.
  7. nhybgtvfr

    nhybgtvfr Member

    interesting. also found some stuff about a similar bug for opcache.use_cwd, recommending setting that to true, or 1 looking at the syntax in the php.ini file.
    i've tried having both that and opcache.validate_timestamps enabled and it didn't make any difference as far as i could see.
    still getting messages referencing the wrong web id in the open_basedir path in the error logs.

    i've just added 'opcache.enable = off' to the custom php.ini settings under the website options tab.

    not sure which is most performant/minimal overhead between either of opcache or xcache, or both together even, but in this case, disabling opcache on those vhosts means the sites actually work. until i see something that shows categorically that having opcache instead of/as well as xcache is a lot faster/less load, that'll do for me.
     

Share This Page