I've got this problem on my Ubuntu + PHP 7.0.18 + Apache2: In my php.ini is set the open_basedir = /var/www:/tmp. It works fine. But in one web app I need to use another dirs to work with. I am trying to set it through ini_set:
ini_set(
'open_basedir',
implode(
PATH_SEPARATOR,
array(
__DIR__,
'/media/hdd/backup/db'
)
)
);
But it has no any effect:
echo ini_get('open_basedir'); // shows /var/www:/tmp
If value of open_basedir in php.ini is empty, this code works fine. Is it an expected behaviour or I'm doing something wrong?