Hestia CP is one of the most popular, simple and convenient panels for site management, with its help you can add new sites, work with mail and databases, Cron, updates, file manager, ability to add SSL .
The site may have problems loading pages related to the open_basedir function, as indicated by the open_basedir restriction in effect error, you can disable this function for a particular site if necessary.
The open_basedir function restricts access from the php scripts of the site to other scripts and directories, which are located outside the site.
Its main purpose is to isolate sites from each other, so that each site "sees" only files/directories in its root directory, and does not interfere with other sites/directories.
To disable this function, go to the templates configuration file and comment out the line that relates to this function.
The templates files are located at the path:
They have names similar to the versions of PHP for which you want to disable open_basedir.
For example, the template for PHP version 8.0 is named PHP-8_0.tpl.
There is a line in this file:
php_admin_value[open_basedir] = .
It should be commented out by adding ; at the beginning of the line to get
;php_admin_value[open_basedir] = .
You can do this with any file editor like nano or vim or use the following command, it will find the line and comment it out.
Note the file name in the command, if you have a different version of PHP don't forget to change the file name as the following example is for PHP 8.0
sed -i 's/php_admin_value\[open_basedir\]/;php_admin_value\[open_basedir\]/g' /usr/local/hestia/data/templates/web/php-fpm/PHP-8_0.tpl
It remains to write changes from templates to the main site configuration file and restart the PHP 8.0 service, all this can be done either manually through the control panel and panel files, or by running the command.
Note, there are 3 variables in the command:
- username (admin) of the control panel where the site is located.
- site domain (example.com).
- name of the template (PHP-8_0) which you edited above.
As above, change these data to match your own before running the command.
v-change-web-domain-backend-tpl admin example.com PHP-8_0
This completes the configuration.
Now you can check if the feature is disabled by using the phpinfo check script.
This is what the open_basedir function looks like when it is turned on.
And when it's off.
Important! Please make sure you've backed up the server before you start.
If you have any difficulties with configuration or have any additional questions, you can always contact our support team via ticket system.