• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    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. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue PHP opend_basedir restriction issues

michaelespinosa

New Pleskian
I need help getting PHP (v5.4.45) errors and permissions working properly after a server was migrated. Some of my sites need to access some files from another domain on the same server.

For example, /var/www/vhosts/planetrockcm.com/httpdocs/test.php might try to include /var/www/vhosts/rock.church/httpdocs/robots.txt using PHP include "/var/www/vhosts/domain1/httpdocs/robots.txt";

In Plesk (v17.5.3) I went into the domain > PHP settings > and modified the open_basedir settings to include /var/www/vhosts/rock.church/httpdocs/ (pic - Dropbox - Screenshot 2018-03-23 15.29.13.png)

I setup an example to show what I'm getting at phpinfo()

Here's what test.php has in it:

<?php

include "/var/www/vhosts/rock.church/httpdocs/robots.txt";

phpinfo();

?>
Here's the error's I'm getting: (pic - Dropbox - Screenshot 2018-03-14 12.31.04.png)

Warning: include(): open_basedir restriction in effect. File(/var/www/vhosts/rock.church/httpdocs/robots.txt) is not within the allowed path(s): (/var/www/vhosts/planetrockcm.com/:/tmp/:/var/www/vhosts/rock.church/httpdocs/) in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3

Warning: include(/var/www/vhosts/rock.church/httpdocs/robots.txt): failed to open stream: Operation not permitted in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3
It is saying there is an open_basedir restriction. The confusing part to me is that I actually added the path in manually as seen in the error itself.

open_basedir restriction in effect. File(/var/www/vhosts/rock.church/httpdocs/**robots.txt) is not within the **allowed path(s): (/var/www/vhosts/planetrockcm.com/:/tmp/:/var/www/vhosts/rock.church/httpdocs/)

I'm really grateful for any help getting this resolved or pointing me in the right direction. My host is saying they are not able to help.
 
Assuming this is a private server with no other clients, you could chmod the website folder 755 I suppose....
 
That seemed to get rid of the open_basedir restriction warning, but I am now getting:

Warning
: include(/var/www/vhosts/rock.church/httpdocs/robots.txt): failed to open stream: Permission denied in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3

@Mark Muyskens Thanks for helping with this! What do you suggest?
 

Attachments

  • Screenshot 2018-03-24 01.34.19.png
    Screenshot 2018-03-24 01.34.19.png
    48.1 KB · Views: 6
Last edited:
How about the file you're including? Let's chmod it to 755 as well....

It has been chmod to 755, but still yielding the same result. You can see it at phpinfo()

Warning: include(/var/www/vhosts/rock.church/httpdocs/robots.txt): failed to open stream: Permission denied in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3
Warning: include(/var/www/vhosts/rock.church/httpdocs/robots.txt): failed to open stream: Permission denied in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3
Warning: include(): Failed opening '/var/www/vhosts/rock.church/httpdocs/robots.txt' for inclusion (include_path='.:/opt/plesk/php/5.4/share/pear') in /var/www/vhosts/planetrockcm.com/httpdocs/test.php on line 3
 

Attachments

  • Screenshot 2018-03-24 04.04.44.png
    Screenshot 2018-03-24 04.04.44.png
    14.8 KB · Views: 7
Back
Top