Different PHP-FPM sites mingle their files when they have identical files-and-paths

Discussion in 'General' started by Galip, Nov 24, 2015.

  1. Galip

    Galip New Member

    1- The problem is about PHP-FPM/FastCGI websites.
    2- We noticed the problem when we got PHP warnings like:

    "PHP Warning: file_get_contents(): open_basedir restriction in effect. File(/var/www/clients/client1/web17/web/www/vendor/symfony/ ... /xliff-core-1.2-strict.xsd) is not within the allowed path(s): (/var/www/clients/client1/web1/web:/var/www/clients/client1/web1/private:/var/www/clients/client1/web1/tmp:/var/www/example.com/web:/srv/www/example.com/web:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin) in (...) XliffFileLoader.php on line 147"

    /var/www/clients/client1/web17 is for another website, it should be /var/www/clients/client1/web1

    3- This problem occurs especially after creating subdomains. Thanks to the open_basedir restriction, we can notice it in error.log. However, when two subdomains in one single website have duplicated site files and folders, they mingle their codes, i.e., when we clone a site folder and create a new subdomain for the new one, unexpected behaviours occur!

    For different websites, say,

    /var/www/clients/client1/web1/index.php is interpreted by PHP as /var/www/clients/client1/web17/index.php. This returns PHP warning, open_basedir restriction.

    For subdomains in single website, say,

    /var/www/clients/client1/web1/sub2/index.php is interpreted by PHP as
    /var/www/clients/client1/web1/sub1/index.php. This does not return any warning, since PHP-FPM users and directories are same. However,

    sub2.example.com responses as sub1.example.com!

    But surprisingly,

    When, I put a dummy comment line at the bottom of the file, /var/www/clients/client1/web1/sub2/index.php, everything works as expected. sub2.example.com responses as it is.

    We speculate that, since /var/www/clients/client1/web1/sub2/index.php is a copy of /var/www/clients/client1/web1/sub1/index.php, their caches should be same or so.

    Ali Galip

    Below are the technical details:

    ISPConfig Version:
    Operating System: Ubuntu 14.04.3 LTS
    PHP Version:
    PHP 5.5.9-1ubuntu4.14 (fpm-fcgi) (built: Oct 28 2015 01:38:24)
    PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)

    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with XCache v3.1.0, Copyright (c) 2005-2013, by mOo
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with XCache Optimizer v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.1.0, Copyright (c) 2005-2013, by mOo
    with XCache Coverager v3.1.0, Copyright (c) 2005-2013, by mOo

    Server version: Apache/2.4.7 (Ubuntu)
    Server built: Oct 14 2015 14:20:21

    Zend OPcache
    Opcode Caching: Up and Running
    Optimization: Enabled
    Cached scripts: 1941
    Cached keys: 1957

    XCache Cacher Module: enabled
    XCache Coverager Module: enabled
    XCache Optimizer Module: enabled

Share This Page