• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Question OpenBasedir: Can't include file from other domain

TimoSchwiersch

New Pleskian
Hi,

I try to include a common directory, in which I's like to store a few classes that I use in multiple projects.
I added the location to the PHP-configuration:

{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}www{/}vhosts{/}domain1.de{/}common.domain1.de{/}inc{/}classes{/}

Then I tried to include one file:

<?php
require_once('/var/www/vhosts/domain1.de/common.domain1.de/inc/classes/input.cls.php');
$Input = new Input('test', 'select');​

But all i got was an error that the path "xyz" is not within the allowed path(s) "...:xyz"

[Wed Feb 14 09:50:08.832661 2018] [proxy_fcgi:error] [pid 6499:tid 140591721580288] [client 87.191.194.184:60720] AH01071: Got error 'PHP message: PHP Warning: require_once(): open_basedir restriction in effect. File(/var/www/vhosts/domain1.de/common.domain1.de/inc/classes/input.cls.php) is not within the allowed path(s): (/var/www/vhosts/domain2.de/:/tmp/:/var/www/vhosts/domain1.de/common.domain1.de/inc/classes/) in /var/www/vhosts/domain2.de/httpdocs/test.php on line 2
PHP message: PHP Warning: require_once(/var/www/vhosts/domain1.de/common.domain1.de/inc/classes/input.cls.php): failed to open stream: Operation not permitted in /var/www/vhosts/domain2.de/httpdocs/test.php on line 2
PHP message: PHP Fatal error: require_once(): Failed opening required '/var/www/vhosts/domain1.de/common.domain1.de/inc/classes/input.cls.php' (include_path='.:/usr/share/php') in /var/www/vhosts/domain2.de/httpdocs/test.php on line 2'​

It is EXACTLY the same path. So whats my fault? I'm confused...

Thanks for your help.
Timo.
 
Back
Top