I've looked at questions (and answers) about openbase_dir where the required or included file was outside the allowed path(s). I've looked at all the suggested similar questions while editing this one, but I didn't find a case like mine.
I'm using Plesk 12.5 on a CentOS VPS.
I have a maindomain.com
with a subdomain.maindomain.com
and also otherdomain1.com
, otherdomain2.com
, otherdomain3.com
and so on.
I need to access some files located in /var/www/vhosts/maindomain.com/subdomain.maindomain.com
from all otherdomains.com
.
In my case I've included in both open_basedir
.:/opt/plesk/php/7.0/share/pear:/var/www/vhosts/maindomain.com/subdomain.maindomain.com
and include_path
{WEBSPACEROOT}{/}{:}{TMP}{/}:/var/www/vhosts/maindomain.com/subdomain.maindomain.com/
the exact path where I need to look into, but I still get the error:
Warning: require_once(): open_basedir restriction in effect.
File(/var/www/vhosts/maindomain.com/subdomain.maindomain.com/filename.php) is not within the allowed path(s):
(/var/www/vhosts/otherdomain.com/:/tmp/:/var/www/vhosts/maindomain.com/subdomain.maindomain.com)
in /var/www/vhosts/otherdomain.com/httpdocs/index.php on line XXX
Warning: require_once(/var/www/vhosts/maindomain.com/subdomain.maindomain.com/filename.php): failed to open stream:
Operation not permitted in /var/www/vhosts/otherdomain.com/httpdocs/index.php on line XXX
Fatal error: require_once(): Failed opening required '/var/www/vhosts/maindomain.com/subdomain.maindomain.com/filename.php'
(include_path='.:/opt/plesk/php/7.0/share/pear:/var/www/vhosts/maindomain.com/subdomain.maindomain.com')
in /var/www/vhosts/otherdomain.com/httpdocs/index.php on line XXX
Summarizing...
I can't access /var/www/vhosts/maindomain.com/subdomain.maindomain.com/filename.php
from /var/www/vhosts/otherdomain.com/httpdocs/index.php
while this path /var/www/vhosts/maindomain.com/subdomain.maindomain.com
is in both open_basedir
and include_path
.
What else am I missing?
Anyone had the same problem?
Thanks