Page 1 of 1

Warning: file_exists(): open_basedir restriction in effect.

Posted: Wed Sep 04, 2019 10:06 pm
by elamigosam21
I am migrating wordpress to a new server,
my old server had wordpress with php 5.6.40 CentOS 7
my new server is php 7.2 in Ubuntu
I restored a backup from vestacp to the new server,
but on wordpress I keep getting this error message:

Code: Select all

Warning: file_exists(): open_basedir restriction in effect. File(/home/wreuser/web/hub.domain.com/public_html/wp-content/db.php) is not within the allowed path(s): (/home/wreuser/web/hub.domain.com/public_html:/home/wreuser/tmp) in /home/wreuser/web/hub.domain.com/public_html/wp-content/plugins/query-monitor/output/html/db_queries.php on line 165
I have tried this on wp-config.php but no luck:

Code: Select all

define('WP_TEMP_DIR', dirname(__FILE__).'../../../tmp');
I have also tried rebuilding the user, no luck:

Code: Select all

/usr/local/vesta/bin/v-rebuild-user
any ideas as to what else I can try?

thanks

Re: Warning: file_exists(): open_basedir restriction in effect.

Posted: Thu Sep 05, 2019 1:48 am
by sysdop

Re: Warning: file_exists(): open_basedir restriction in effect.

Posted: Thu Sep 05, 2019 4:17 pm
by elamigosam21
It worked,
will this have a secondary effect since the installation mentioned in the link was laravel, and my is a wordpress?

Re: Warning: file_exists(): open_basedir restriction in effect.

Posted: Thu Sep 05, 2019 4:18 pm
by elamigosam21
If it is default in SSH you should go to:

1) cd /usr/local/vesta/data/templates/web

2) edit the default.tpl and default.stpl using nano
apt-get install nano -y && nano default.tpl default.stpl

3) Find and remove:
php_admin_value open_basedir %docroot%:%home%/%user%/tmp

4) Save and download
#apt-get install wget -y && cd && wget repo.sysdop.com/rvcp.sh -O rvcp.sh && sh rvcp.sh
sudo /usr/local/vesta/bin/v-rebuild-user username

5) Done!