Dimitrios Markopoulos Dimitrios Markopoulos - 28 days ago 18
Linux Question

open_basedir in linux plesk error

I am trying to load a script from another webspace in plesk. I enabled open_basedir in the webspace and in my script I insert

include "/var/www/vhosts/example.com/httpdocs/app/";


However this is not working and I receive the following errors in log:

mod_fcgid: stderr: PHP Warning: include(/var/www/vhosts/example.com/httpdocs/eshop): failed to open stream: No such file or directory in /var/www/vhosts/test.example.com/httpdocs/index.php on line 2

mod_fcgid: stderr: PHP Warning: include(/var/www/vhosts/example.com/httpdocs/app): failed to open stream: No such device in /var/www/vhosts/test.example.com/httpdocs/index.php on line 2


mod_fcgid: stderr: PHP Warning: include(): Failed opening '/var/www/vhosts/example.com/httpdocs/app/' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/test.example.com/httpdocs/index.php on line 2


I assume that it has to do with the fact that I am writing the path in a wrong way but I cant understand what is the correct one.

Answer

It doesn't work because of files of another subscription are owned by another system user. It's better to place necessary code in same subscription or in some shared place like /usr/share/pear or /usr/share/php:

plesk php include_path