S
S
shaman3602020-06-22 22:33:24
PHP
shaman360, 2020-06-22 22:33:24

How else to solve the problem with open_basedir?

I need to connect a script that is located above the /public_html/ directory from under a different domain
When transferring a site to a new server with such a connection, I see an error

Warning: file_exists(): open_basedir restriction in effect

I know what this error is and why it appears, but in practice I don't know how to fix it.
Server - Ubuntu 18, VestaCP panel.

By sFTP, I do not have privileges to edit files, so I use ssh.
By ssh, I go to the /home/admin/conf/web directory,
then I edit the file and domain.ru.apache2.conf (which contains the final files) and the domain.net.apache2 file .conf (the domain from which the final files are connected), while deleting the php_admin_value open_basedir line parameter , more precisely implementing this code
php_admin_value open_basedir none
Next, I restart the service, but I still see an error
Warning: file_exists(): open_basedir restriction in effect. File(/home/admin/web/domain.ru/public_html/*****) is not within the allowed path(s):


How can I solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2020-06-22
@Nc_Soft

Try via htaceess
php_value open_basedir "none"

S
Sergey Brovko, 2020-06-25
@cyber01

Try to specify one path in open_basedir first (as it was in the original), and then specify the path to the second site through a colon, on the second it is similar

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question