How to Disable the open_basedir Setting in cPanel and Plesk

0
162

The open_basedir function defines the locations or paths from which PHP is allowed to access files using functions like fopen() and gzopen(). If a file is outside of the paths defined by open_basdir, PHP will refuse to open it. You cannot use a symbolic link as a workaround, because the path that the symbolic link resolves to falls under the restrictions of the open_basedir function.

When trying to install some PHP script, it is very common sometimes to get the error message below.

ERROR: Please disable the open_basedir setting to continue.

If you are getting such error, you will have to disable the open_basedir setting before you can continue such installation. So for those of us who do not know how to do that, here is a simple guide basically for cPanel and Plesk.

Disabling open_basedir Setting in cPanel

There are three ways to disable open_basedir restriction in cPanel.

1. Site wide

  • Open your php.ini and look for the open_basedir line and comment it.
  • Save your php.ini changes and restart your web server

2. By specific site

This configuration works only on apache web servers.

  • Open your apache web server’s configuration file (httpd.conf) and at the bottom type this line.

php_admin_value open_basedir “none”

  • Save and restart your apache web server.

3. From the PHP Settings

  • Go to cPanel and look out for PHP Settings.

PHP Settings

  • Open the settings of the default PHP version and disable open_basedir feature.

Disabling open_basedir Setting in Plesk

This is very simple as all we just need to is disable open_basedir for the domain we are working on.

  • In Plesk, locate and click on PHP Settings.

Disable open_basedir in Plesk

  • Move down the PHP Settings page to open_basedir and click on the drop down box.

Disable open_basedir in Plesk2

  • Select None from the drop down list.

Disable open_basedir in Plesk3

 

  • Finally, scroll down and click on Apply then Ok to save the changes you just made.