• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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