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