As the title says, how do I add a path to the open_basedir in Plesk for all domains?
I have to change the open_basedir value for all domains from:
{DOCROOT}/:/tmp/
to:
{DOCROOT}/:/tmp/:/var/www/vhosts/{DOMAIN?}/
I know where to do it, I just don’t know what the variable is for the parent of {DOCROOT}
2
Answers
I don’t know about Plesk 10.3, but in Plesk 10.4 there is {WEBSPACEROOT} which exposed to /var/www/vhosts/%domain-name%/. So, you just need to replace “{DOCROOT}/:/tmp/” to “{WEBSPACEROOT}/:/tmp/” in PHP settings of Service Plan.
And it’s a default settings in Plesk 11.0.
For Plesk 10.0, for case when php works as Apache module:
in /usr/local/psa/admin/conf/templates/custom/service/php.php replace strings
to
and run:
But for CGI and FastCGI there is need to change /var/www/vhosts/domain-name/etc/php.ini file and I don’t know how deal with it.
I’ve used the Oleg’s solution for php.php template at plesk 11 and just changed the following code:
to
This is not a very robust solution as can made more option replaces than needed, but that works in common cases (adds /php/includes/ directory into open_basedir option).
Commonly those changes might be done via plesk service plan correction, but when you have too many domain with custom service plans – that might be a pain changing all the domain settings.