Plesk

A website hosted in Plesk is not accessible: open_basedir restriction in effect

Symptoms

Cause

The PHP script is trying to access the folder for which access is not allowed. This restriction is defined by the PHP open_basedir variable for each domain separately. By default, open_basedir allows access to the tmp and domain's document root directories, as well as the system's default sessions path.

Resolution

  1. Log in to Plesk.

  2. Go to Domains > example.com > PHP Settings.

  3. Add the path from the error message to the open_basedir field:

    • on Linux

      Below is an example for the directory /path/to/the/directory:

      {WEBSPACEROOT}{/}{:}{TMP}{/}{:}/path/to/the/directory

    • on Windows

      Below is an example for the directory E:pathtothedirectory:

      {WEBSPACEROOT}{/};{TMP};{/};"E:pathtothedirectory"

  4. Apply the changes.

Note: The default session.save_path for Linux is (RedHat-based) /var/lib/php/session/ or (Debian-based) /var/lib/php/sessions/, and for Windows is C:WindowsTemp