• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

vhost.conf include_path and open_basedir

T

Tomster

Guest
Hi all,

I'm new here and before people jump on me and say 'use search' after just looking at the title, believe me when I say I have searched these forums over and over clicking through every link in each post as well to various other documents and posts as well as various google searches to find a solution to my problem.

I have a file located in /var/www/vhosts/site.tld/includes

that is throwing up an error when i try to include it and i use the following in my vhost.conf file
Code:
<Directory /var/www/vhosts/site.tld/httpdocs>
        #<IfModule sapi_apache2.c>
				php_admin_flag register_globals off
				php_admin_value safe_mode off
                #php_admin_value open_basedir  ".:/usr/share/pear:/var/lib/php/session:/var/www/vhosts/site.tld/includes:/var/www/vhosts/site.tld/httpdocs:/tmp"
                php_admin_value upload_tmp_dir /tmp	
				php_admin_value include_path ".:/usr/share/pear:/var/www/vhosts/site.tld/includes:/var/www/vhosts/site.tld/httpdocs"
     # </IfModule>
	 
</Directory>

It will however include a file in the PEAR directory.

Now if I take away the # in front of Ifmodule neither file will be included.

If I put a # in front of the open_basedir declaration it wont include the file located in /var/www/site.tld/includes but does include the pear directory.

To say that this is becoming frustrating is an understatement. I've been trying to solve this problem all night by searching through here and elsewhere but to no avail. I've tried various combinations of listing the directories in different orders as well. I'm new to Linux but I really would liked to have worked this out myself instead of asking for help so if anyone does know the solution can they please also explain it to me instead of just 'spoon feeding' me the correct code?

FYI i am using
FC4
plesk 8.1
php 5.2.3
zend engine 2.2.0

I would greatly appreciate any help anyone has to offer.

Many Thanks
 
I believe it'll work when you add both the includes dir and the pear path to the open_basedir path and don't bother with the include_path.
 
Hi,

thanks for replying. I tried what you suggested and now I'm getting the error that it cant include the file in the includes folder again

Warning: require_once(requirefile.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/vhosts/site.com/httpdocs/file.php on line 6

Fatal error: require_once() [function.require]: Failed opening required 'requirefile.php' (include_path='.:/usr/share/pear') in /var/www/vhosts/site.com/httpdocs/file.php on line 6
 
You're getting a 'no such file or directory' error. Are you sure what you're including actually exists?
 
Yeah it's definately there. That was the first thing i checked. All the files are and the folders are owned by the correct user as well thats why its really thrown me out.
 
Back
Top