Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 524
  • Last Modified:

Trouble with open_basedir

Usually I like to set MySQL connection info away from root
on my server it has always worked fine.
on the same server with PLESK and a new dedicated IP I did set up a new site (named here example.com!)
but it keeps rejecting my include tentative
I need to access from root to

As is:
In php.ini open basedir is commented
there is no ref to open basedir in httppd
I have all access, SSH etc..

what could I do? How can I make it going through?
Error received:
Warning: include() [function.include]: open_basedir restriction in effect.
File(/var/www/vhosts/example.com/test2.php) is not within the allowed path(s): (/var/www/vhosts/example.com/httpdocs/:/tmp/) in /var/www/vhosts/example.com/httpdocs/test.php on line 2

I simplified the include for testing, instead I use:
 realpath($_SERVER['DOCUMENT_ROOT'] . '/../inc_support/') 
 . ini_get ('include_path'));

Open in new window

  • 3
  • 2
2 Solutions
This should resolve your issue. Be sure to backup any files that you are editing.

1. Add file vhost.conf to /var/www/vhosts/YOURDOMAIN/conf folder with the following:

<Directory /var/www/vhosts/YOURDOMAIN/httpdocs/>
<IfModule sapi_apache2.c>
php_admin_value open_basedir none
<IfModule mod_php5.c>
php_admin_value open_basedir none

Open in new window

2. Reload server configuration, either via Plesk admin or through CLI:

/usr/local/psa/admin/sbin/websrvmng -u --vhost-name=yourdomain

Open in new window

Ray PaseurCommented:
I use this statement:


The "uproot" directory is on my server in a parallel universe with the "www" directory that holds the web root.  In my phpinfo() display, open_basedir says "no value."  The behavior of this directive has been changed recently.
array007Author Commented:
Hi Ray,
my info reads:
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Ray PaseurCommented:
Curious... Who is your hosting company?

Have you tried the suggestion from g3nu1n3?  It looks pretty much right to me.
array007Author Commented:
I am with JaguarPC
Yes, I will later try vhosts conf mods

Ray PaseurCommented:
I couldn't find any really strong recommendations when I searched for reviews of JaguarPC, and certainly the strength of tech support is, to my mind, the greatest differentiating factor in choosing a web host.  If you're not "married" to JaguarPC you might consider a different hosting company (in case our suggestions do not get things fixed up for you).  I use and am pleased to recommend ChiHost.com for their excellent support.  I have also had good experiences with Hostgator and LiquidWeb.  Some of my colleagues recommend ServerGrove for PHP hosting.  I do not recommend GoDaddy or SiteGround because I have had poor experiences with their technical support.

In any case, best of luck with it! ~Ray

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now