PHPology is a collective of highly skilled, award winning, web gurus.

Disable open_basedir in Plesk

From time to time there will be a situation where you would need to disable open_basedir if you are hosting with Plesk.

What is open_basedir?
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.

Below are the steps I use to complete that task:

Create a new file, called vhost.conf
This file will include anything you want to disable from httpd.conf main config from your virtual host.

1.# touch /var/www/vhosts/

Now we edit the file and we add the following,
1.# vi /var/www/vhosts/

<Directory /var/www/vhosts/>
php_admin_value open_basedir none

Once you finish adding the mentioned lines, its time to reconfigure and restart the webserver config.
1.# /usr/local/psa/admin/sbin/websrvmng -v -a

open_basedir for should be disabled by now.