If loading pages on the site is accompanied by issues related to open_basedir, the specified function can be disabled. This is indicated by the error open_basedir restriction in effect, which occurs in the [error logs] on the server or on the site pages.
The essence of open_basedir is to restrict PHP scripts on the site from accessing other directories and scripts located outside its boundaries. The main purpose of the function is to isolate sites so that each one can access files or directories within its root directory without interfering with similar systems of other sites.
The relevance of the algorithm provided below remains for the Hestia panel. Before starting, the user must ensure that a [server snapshot] has been taken, as the responsibility for the process lies with the server owner. The steps are as follows:
- Commenting out the line related to the specified function in the template config file. The location of the template files can be found at /usr/local/hestia/data/templates/web/php-fpm/. Their names are similar to the names of PHP versions. For example, for version 7.4, there is a template named PHP-7_4.tpl. The line php_admin_value[open_basedir] = needs to be commented out. A semicolon is added at the beginning of the line like this: ;php_admin_value[open_basedir] = … This task can be accomplished in any text editor — for example, vim or nano. The command sed -i ‘s/php_admin_value\[open_basedir\]/;php_admin_value\[open_basedir\]/g’ /usr/local/hestia/data/templates/web/php-fpm/PHP-7_4.tpl will help. Note that the filename should correspond to the desired PHP version. The user should change the name as needed.
- Make changes to the main site configuration and restart the PHP service. This is done manually using the control panel or via the command v-change-web-domain-backend-tpl admin example.pp.ua PHP-7_4. In this line, there are three variables: username, site domain, and template name — respectively admin, example.pp.ua, PHP-7_4. The user modifies these details as needed before executing the command.
- Check the disabling of the function.
The final step is performed using the phpinfo script.
