• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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