Journal
This is a pretty common issue, particularly when running certain content management systems on servers with Plesk installed that sets directory restrictions by default, fortunately it’s pretty easy to fix on a per account basis if you have root access to your server enabled.
Normally you shouldn’t be disabling this unless you have a good reason, but there are some cases where it’s useful like keeping administration control panels above the www root on the account.
First of all SSH to your server and gain root access.
cd /var/vhosts/sitename.com/conf
Replace sitename.com in the above command with the domain name of the site you wish to remove the restrictions for. Create vhost.conf file if one doesn’t exist, or edit an existing.
vi vhost.conf
add the following lines in making sure to change the domain name in the path:
<Directory /var/www/vhosts/sitename.com/httpdocs> php_admin_flag safe_mode off php_admin_value open_basedir none </Directory>
That will disable php safe mode and any basedir restrictions for this domain only.
You don’t need to restart httpd but you’ll need plesk to reconfigure it’s sites with the following command.
/usr/local/psa/admin/bin/httpdmng --reconfigure-all
If you have a lot of sites on the server you can just reconfigure a single domain which will be much quicker.
/usr/local/psa/admin/bin/httpdmng --reconfigure-domain yourdomain.com
Thats it! PHP safe mode and any Open Base Dir restrictions should now be removed.
If you need to do this for a sub domain then do exactly the same thing in:
cd /var/vhosts/sitename.com/subdomains/subdomainname/conf