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

Printed from: http://rackerhacker.com/2007/05/23/remove-php-open_basedir-restriction-in-plesk/ .
© Major Hayden 2012.

5 Comments   »

  • AprilFloyd says:

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

  • 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.

  • 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

  • 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.

  • Geek says:

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

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this