• 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 PHP open_basedir 'not within the allowed path(s)'... but it is

Erwan

Regular Pleskian
Hi all,

We have 2 subscriptions with one domain we have on a Plesk server that work perfectly.
We must migrate this 2 subscriptions on a new server (Centos end of life => debian).

We have simulate it. All works only one thing: the domain 2 can not access to the files to the domain 1.
The directory is always on the "open_basedir" configuration of the domain 2:

{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/var/www/vhosts/mydomain1/httpdocs

But we have this error:
open_basedir restriction in effect. File(/var/www/vhosts/mydomain1/httpdocs/dir1/) is not within the allowed path(s): (/var/www/vhosts/mydomain2/:/tmp/:/var/www/vhosts/mydomain1/httpdocs)

What's the problem? Why does it work on the current server and not the new one?

Same problem if i use the same directory:
open_basedir restriction in effect. File(/var/www/vhosts/mydomain1/httpdocs/dir1/) is not within the allowed path(s): (/var/www/vhosts/mydomain2/:/tmp/:/var/www/vhosts/mydomain1/httpdocs/dir1)

An idea? Thank you.

Erwan
 
I had the same issue with PHP 7.4.21: PHP: PHP 7 ChangeLog
This bugfix gave the same error you are getting:
- Fixed bug #76359 (open_basedir bypass through adding "..").

I couldn't find a solution so temporarily switched to PHP 7.3.30
 
I thought you have found the problem Maartenv... but websites are under PHP 7.3... :(
Thanks anyway.

If you are another idea, do not hesitate. I still have the problem.
 
Add the trailing / and try again. All the other paths have a / at the end, so yours should too.
 
I've already try it:
{WEBSPACEROOT}{/}{:}{TMP}{/}:/var/www/vhosts/mydomain1/httpdocs/
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/var/www/vhosts/mydomain1/httpdocs/
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/var/www/vhosts/mydomain1/httpdocs{/}

:(
 
Back
Top