2.8.17. open_basedir

Important points:

  • The only way to completely isolate sites from one another is to host them on separate hosting accounts.
  • This setting is automatically disabled while the PHP profiler is running.

The open_basedir parameter limits the access level for the site's PHP scripts.

It is important to note that using this parameter cannot ensure complete isolation between sites within a single hosting account. This is because the parameter restricts access to files only through PHP, but if files are accessed outside the set permissions via workarounds, such as by calling commands via shell_exec (potentially dangerous internal PHP functions that are not used by the site's scripts can be disabled), access will not be restricted.

In situations where a site's scripts attempt to access files that are restricted by open_basedir, the site may display the "open_basedir restriction in effect" error.

  1. In the "open_basedir" field, select the desired access level and save your changes:
    • "/home/example/example.com/www" — access is restricted to the site root directory.
    • "/home/example/example.com" — access is restricted to the parent directory of the site root directory.
    • "/home/example" — access is restricted to the root directory of the hosting account.
    • "disable" — access is not restricted.
  2. Wait approximately 10-15 minutes for the changes to take effect.
Content