• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Cannot add custom folder to the open_basedir PHP option.

KevinPrimate

New Pleskian
Server operating system version
AlmaLinux 8.8 (Sapphire Caracal)
Plesk version and microupdate number
18.0.58 #2
I have a drupal hosted in my plesk and the private folder is above the {WEBSPACEROOT} route. So it is not possible to add new folders with the default plesk value for the open_basedir configuration. So I tried to add a new route in the open_basedir configuration. I tried to use the absolute path to the private folder, but it did`nt worked, so I started to try from /var (worked), but as soon as I added /var/www it stopped working, so i cannot add the absolute path because it is obviously inside /var/www...

I also tried relative paths and multiple syntaxis for both absolute and relative paths, but nothing worked, and obviously I cannot let the open_basedir option on none or /var.
 
If you're adding it in the open_basedir setting section of the domain though the PHP settings, you should be able to add it like so:

Code:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}www{/}test{/}

1710513723111.png
1710513789790.png
 
If you're adding it in the open_basedir setting section of the domain though the PHP settings, you should be able to add it like so:

Code:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}www{/}test{/}

View attachment 25760
View attachment 25761
That`s the issue, it is supossed to work, but it does not. If I add like you posted {WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/}www{/}test{/} , it doesn`t work. If it is only {WEBSPACEROOT}{/}{:}{TMP}{/}{:}{/}var{/} it does, but with the www or deeper directories it just don`t.
 
Where are you pasting it? Copy and paste or show a screen shot of what you are pasting in. What does the PHP Info show as well?
 
Where are you pasting it? Copy and paste or show a screen shot of what you are pasting in. What does the PHP Info show as well?
In the open_basedir configuration. In the screenshot you can see that i have added the /var/www (it doesn`t works) but if i add just /var or just put the open_basedir on none, it works. In my web, I have a form that tries to create a folder on the /src/private/webform/(name of the form)/(new folder), but it can`t create the new folder because the {WEBSPACEROOT} you see is pointing at /src/web.
 

Attachments

  • Captura.PNG
    Captura.PNG
    11.9 KB · Views: 3
I have managed to configure Drupal to operate on files within the private folder while keeping the open_basedir set to its default value.After some research, I discovered that Drupal uses a stream wrapper for the private directory, denoted by "private://". However, for some reason, it is unable to create subfolders using this wrapper on my server. Using absolute paths works correctly. As a temporary solution, I patched one of the Drupal core files to use absolute paths instead of the wrapper.Nevertheless, I would like to understand why this is happening. Is there any configuration I should change to enable the stream wrapper functionality? Modifying the Drupal core files does not seem to be the most efficient option...

To add some context, the change made on the drupal code was changing
Code:
return mkdir($uri, $mode, $recursive, $context);
to
Code:
return mkdir($this->realpath($uri), $mode, $recursive, $context);
 
Back
Top