You're looking for the PHP setting open_basedir
which limits the files that can be accessed by PHP to the specified directory-tree.
Note the disclaimer:
Caution
open_basedir
is just an extra safety net, that is in no way comprehensive, and can therefore not be relied upon when security is needed.
Like many settings for PHP it can be set in the php.ini configuration file.
open_basedir = /path/to/run/
And depending on how your run PHP files ( as Apache mod_php) maybe also in Apache httpd configuration files, in the main httpd.conf
and includes for example in VirtualHost
and/or Directory
blocks and .htaccess
files.
php_value open_basedir "/path/to/run/"
php_admin_value open_basedir "/path/to/run/"