Proper use of open_basedir or how to avoid problems?

Hello everyone!

The situation is this: it is necessary to restrict the user in his folder, suppose:

/var/www/user/

I add the following to the virtual host config. Code:

...
 DocumentRoot /var/www/user 
 <Directory /> 
     php_admin_value open_basedir /var/www/user 
     Options FollowSymLinks 
     AllowOverride All 
 </Directory> 
 <Directory /var/www/user> 
     php_admin_value open_basedir /var/www/user 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Order allow,deny 
     allow from all 
 </Directory>
 ...

I get PHP errors when loading a script from the /var/www/user/folder:

[phpBB Debug] PHP Notice: in file /common.php on line 223: require(): open_basedir restriction in effect. File() is not within the allowed path(s): ()
[phpBB Debug] PHP Notice: in file /portal.php on line 20: include(): open_basedir restriction in effect. File() is not within the allowed path(s): ()


Answer 1, authority 100%

in file /common.php

You are trying to include the common.php file from the root, hence the error.