• 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

Issue open_basedir changes not working

serial

New Pleskian
Hi,

I try to access a file in from php in websiteA in websiteB homedir.

For example test.php in websiteA
<? require('/home/httpd/vhosts/<domainb>/httpdocs/testinclude.php');
?>

When i do that i will get a open_basedir restriction as expected and a 500 error
[Sun Mar 17 14:34:18.055943 2019] [proxy_fcgi:error] [pid 27457] [client xxxxx:37021] AH01071: Got error 'PHP message: PHP Warning: require(): open_basedir restriction in effect. File(/home/httpd/vhosts/<siteb>/httpdocs/testinclude.php) is not within the allowed path(s): (/home/httpd/vhosts/<sitea>/:/tmp/) in /home/httpd/vhosts/<sitea>/httpdocs/test.php


All the documentation i can find point in the direction to change the open_basedir path in the php settings in plesk onyx

So i go to domain->php settings->open_basedir
I enter {WEBSPACEROOT}{/}{:}{TMP}{/}:/home/httpd/vhosts/<websiteb/httpdocs/

Save the whole stuff and try again, unfortunately
[Sun Mar 17 14:35:18.055943 2019] [proxy_fcgi:error] [pid 27457] [client 149.210.167.40:37021] AH01071: Got error 'PHP message: PHP Warning: require(): open_basedir restriction in effect. File(/home/httpd/vhosts/<siteb>/httpdocs/testinclude.php) is not within the allowed path(s): (/home/httpd/vhosts/<sitea>:/tmp/:/home/httpd/vhosts/<siteb>/httpdocs/) in /home/httpd/vhosts/<sitea>/httpdocs/test.php

Any ideas ?

I've tried chmod 777 the file, but nothing seems to help.
 
This is not possible. You cannot access any files of domainB from domainA, regardless of open_basedir settings.
 
Back
Top