Remove PHP’s open_basedir restriction in Plesk

If you have an open_basedir restriction that is causing issues with a domain, you can remove the restriction easily. First, put the following text in /home/httpd/vhosts/[domain]/conf/vhost.conf:

<Directory /home/httpd/vhosts/[domain]/httpdocs>
php_admin_value open_basedir none
</Directory>

If there was already a vhost.conf in the directory, then just reload Apache. Otherwise, run the magic wand:

/usr/local/psa/admin/bin/websrvmng -av

Then reload Apache:

/etc/init.d/httpd reload

Tagged , ,

6 thoughts on “Remove PHP’s open_basedir restriction in Plesk

  1. AprilFloyd says:

    I have tried this but the restriction has not removed. any ideas

  2. aarts says:

    What if it is a shared server? The hosting company will not allow you to change this value, you can not even access de conf directory for your domain.

    Is there any way around?

    Thanks.

  3. Thank you very much. This worked for me – which cannot be said about the original How-To of Parallels:

    http://kb.parallels.com/article_41_432_en.html

    The only thing I had to replace is the last line of code, since my apache was located differently:

    /etc/init.d/apache2 reload

  4. MikeRoberts says:

    For those having troubles getting vhosts.conf to override the main config, or those who want to make it a default for all sites added to the server, you can also change the template file plesk uses to build the main config file (httpd.include)

    Change the open_basedir to what you need here:

    /usr/local/psa/admin/conf/templates/default/service/php.php

    Then reload.

  5. Geek says:

    I did that but it changed nothing for https requests, why?

  6. s17 says:

    Worked for me! Was having troubles with CURLOPT_FOLLOWLOCATION.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>