Updated: 13 November 2026 · Applies to: DirectAdmin

open_basedir limits which folders a PHP script is allowed to open. Admin level can turn it off for new domains by default, or switch it off for one domain at a time. Only turn it off for a domain that genuinely needs to reach a folder outside its own account, since it removes an important layer of protection between accounts on the same server.

Steps (admin level)

  1. Log in to DirectAdmin as admin (usually https://your-server:2222).
  2. Open PHP Configurations, under Admin Level. On older panels this setting is under Extra Features, in PHP SafeMode Configuration instead; PHP itself dropped safe mode years ago, so that page name is now just where this option and a few related switches still live.
  3. Find Open BaseDir. Setting the default here applies to domains created from now on. The same page also lists existing domains, where you can turn the restriction off for one domain without changing the server default.
  4. Save.

A safer alternative

Rather than turning open_basedir off completely, you can usually add the one extra folder a script needs to the domain's existing path instead, so the rest of the restriction still applies. According to DirectAdmin, this is done from the same PHP configuration area, by adding the folder to the domain's open_basedir path rather than clearing it.

PHP-FPM servers

If the domain runs PHP through PHP-FPM rather than through Apache's own PHP module, the admin-level toggle does not always reach it, because PHP-FPM, not Apache, is the process actually running the PHP code. According to DirectAdmin's documentation, a per-domain PHP setting for PHP-FPM is instead placed in a file such as /usr/local/phpXX/lib/php.conf.d/30-domain.com.ini (replace phpXX with the PHP version folder), using a [HOST=domain.com] section, after which the web configuration needs rebuilding. You can check which mode a domain uses from the php1_mode setting in CustomBuild.

After changing it

A domain running without open_basedir at all can read any file the web server's own user account can read, not just its own files. Never add a whole server path such as /, or another account's home folder, to an open_basedir setting; add only the specific folder the script needs.

Official documentation: DirectAdmin PHP options.

Related services

Server management

on-demand administration, hardening, migrations and monitoring.

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Was this answer helpful?

Still stuck? Open a ticket