• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

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