• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

Resolved Unknown: open_basedir restriction

calu

Basic Pleskian
Server operating system version
Ubuntu 20.04.5 LTS
Plesk version and microupdate number
Plesk Obsidian v18.0.48_build1800221104.03 os_Ubuntu 20.04
Hi there, after migrating a site from another server with cPanel, to a VPS running Plesk, I can only access my sites dashboard as admin, all other attempt to asses the site url creates the "There has been a critical error on your website" issue.

In the Plesk Websites & Domains log of the site I see the following PHP error:

AH01071: Got error 'PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/var/cpanel/php/sessions/ea-php73) is not within the allowed path(s): (/var/www/vhosts/domain/:/tmp/) in Unknown on line 0'

So the issue is probably about Unknown: open_basedir restriction, but I haven't found a solution for solving this. It's like some old cPanel settings are affecting the settings on the new server?

Can anyone explain what this issue is about and how to fix it?

Thanks.
 
There is some code that's trying open a path (/var/cpanel/php/sessions/ea-php73) that it's not allowed to open (and most likely doesn't exist at all).

Are you using any composer packages by any change that are included in your website/app/project with autoload? If that's the case run composer dump-autoload to reconfigure the autoload.
 
Last edited:
Have you checked your website's configuration file (normally something like config.php, /inc/config.php or so) if there are paths that need to be matched to your new website location?
 
Hi there, I think I'm onto something here:

Note that disabling the open_basedir restriction globally in Plesk will not work for domains already created in it. It will work only for the domains created after the change. To disable open_basedir restriction for current domains, each domain must be edited individually. Here’s the procedure:

Go to Domains > (the domain you want to modify) > Websites & Domains > Advanced Operations > Website Scripting and Security > PHP Settings. Here, enter custom value for the open_basedir option (its in common settings), to put {DOCROOT}\;\Windows\Temp\ as the value. Now, recycle the domain’s application pool which will automatically update the php.ino file created by Plesk.

The question is if {DOCROOT}\;\Windows\Temp\ is the correct value on an Apache server?
 
You do not want to disable it. All your files shall be in your own subscription and shall also only access your own subscription space. You need to find the file that defines that some path is /var/cpanel/php/sessions while it should be something like /var/www/vhosts/<domain>/sessions.
 
On second thought, looking at the path and the fact that you mentioned you migrated from cPanel, you might want to check the PHP session.save_path setting of your domain first. Which can be found at example.com > PHP Settings. Is it set to /var/cpanel/php/sessions/ea-php73 or to the default path shown in the image below?
Schermafbeelding 2022-12-28 174737.png
 
define( 'AUTH_KEY',
define( 'SECURE_AUTH_KEY',
define( 'LOGGED_IN_KEY',
define( 'NONCE_KEY',
define( 'AUTH_SALT',
define( 'SECURE_AUTH_SALT',
define( 'LOGGED_IN_SALT',
define( 'NONCE_SALT',
define( 'WP_CACHE_KEY_SALT',
All these values in wp-config.php are identical as on the old server, should they be the same?
 
Okay, good thing we can get that of our list with possible causes for your issue. Now, as for the open_basedir setting, as far as I know the {DOCROOT}\;\Windows\Temp\ value is only applicable to Plesk running on Windows. Unless you have a specific need to change the open_basedir setting, leave it a the default value, which is {WEBSPACEROOT}{/}{:}{TMP}{/}.

If you are running a Wordpress site, make sure you've deleted all cache and disable any caching plugins (if you have any).
 
I think I can rule out any cache issues, I'm only using CloudFlare caching which has been purged
 
No refrences of that kind

# This file was updated by Duplicator on 2022-12-25 15:36:30.
# See the original_files_ folder for the original source_site_htaccess file.
# BEGIN WordPress
# Direktiverne (linjer) mellem 'BEGIN WordPress' og 'END WordPress' er
# dynamisk genereret og bør kun ændres via WordPress-filtre.
# Eventuelle ændringer i direktiverne mellem disse markører vil blive overskrevet.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
 
From the developer of Duplicator

By default the .htaccess is reset to a minimalist version, This helps to support the transition, and avoid additional issues on the new server or environment.
 
There a couple of places where this cpanel path can be set.
- in the database: search for cpanel using PHPMyAdmin (accessible from Plesk).

Screenshot 2022-12-28 at 19.50.15.png

- in one of the config files of the subscription:
Code:
# cd /var/www/vhosts/system/domain.com/conf/
# grep cpanel *
 
Hi there, if I search for cpanel, there is one match in the prefix_options table, but I can't read anything out of it about cPanel.

_transient_feed_d117b5738fbd35bd8c0391cda1f2b5d9
a:4:{s:5:"child";a:1:{s:0:"";a:1:{s:3:"rss";a:1:{i:0;a:6:{s:4:"data";s:3:"


";s:7:"attribs";a:1:{s:0:"";a:1:{s:7:"version";s:3:"2.0";}}s:8:"xml_base";s:0:"";s:17:"xml_base_explicit";b:0;s:8:"xml_lang";s:0:"";s:5:"child";a:1:{s:0:"";a:1:{s:7:"channel";a:1:{i:0;a:6:{s:4:"data";s:61:"

I'm not sure where to look for this one, which subscription are you refering to?
- in one of the config files of the subscription:
 

Attachments

  • Skærmbillede 2022-12-28 kl. 21.04.23.png
    Skærmbillede 2022-12-28 kl. 21.04.23.png
    87.2 KB · Views: 6
Hi there, if I search for cpanel, there is one match in the prefix_options table, but I can't read anything out of it about cPanel.




I'm not sure where to look for this one, which subscription are you refering to?

You should be able to edit the record in PHPMyAdmin carefully.

By subscription, I mean the domain on which this site is installed.
 
Thanks, I just don't what I should edit, as the content of the table does not say me nothing.
 
Thank you, I have been going through options.php, but I can't find anything which refers to cpanel unfortunately.
 
Back
Top