Error "open_basedir restriction in effect"

Error "open_basedir restriction in effect" occurs when the script tries to access a file located in any of the directories at a level higher than that specified as the parameter value open_basedir.

To remedy the situation, one of the following conditions must be met:

  • Place the target file in a place accessible to the script. That is, in the directory specified as the value of the open parameter_basedir, or in any of its subdirectories.
  • Disable or change the value of the open parameter_basedir to the required directory so that the executable script has access to it.
  • Use command calling functions exec to work with such files. Open action_basedir does not apply to commands executed in the CLI. Note, this method is extremely unsafe.