0

Does anyone know if it is possible to include a parent directory of a {WEBSPACEROOT} PHP 5.5.22?

This is the given structure which does work with {WEBSPACEROOT}:

var/www/vhosts/mydomain-a/website  
var/www/vhosts/mydomain-a/includepath  
var/www/vhosts/mydomain-b/website  
var/www/vhosts/mydomain-b/includepath  

I want this:

var/www/vhosts/mydomain-a/website  
var/www/vhosts/mydomain-b/website  
var/www/vhosts/includepath  

I am using Plesk 12 with a root server and haven't been able to solve the issue within the php-panel of Plesk. The php.ini seems to be ignored by Plesk.
So I will always receive this error:

 open_basedir restriction in effect. File(../../includepath/include.php) is not within the allowed path(s): (/var/www/vhosts/mysite.com/:/tmp/)  

I have been looking into suggestions like this, but they do seem to me like if they would imply tackle the very first approach: https://www.vimp.com/de/web/faq/items/an-example-of-a-vhostconf-with-plesk.html

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
leopold
  • 1,971
  • 1
  • 19
  • 22
  • 1
    For safety reasons, your server software is preventing the site from accessing files outside its webroot - in theory a great idea. Keep the include path inside your web root, and use something like `.htaccess` to `deny from all` in that subfolder. – Niet the Dark Absol Mar 02 '15 at 16:12
  • Thanks Niet, I know that this might open a security issue. But do you know a solution if I want to use a structure like this or if I need to open that Gateway? – leopold Mar 02 '15 at 18:15

1 Answers1

0

Does your domain's PHP handler works as FastCGI?

You can just change domain's PHP settings "open_basedir" to

/var/www/vhosts{/}{:}{WEBSPACEROOT}{/}{:}{TMP}{/}

After this in file:

/var/www/vhosts/system/domain.tld/etc/php.ini

you'll get:

open_basedir = "/var/www/vhosts/:/var/www/vhosts/domain.tld/:/tmp/"
Oleg Neumyvakin
  • 9,706
  • 3
  • 58
  • 62
  • Thanks Oleg, I have tried to change the settings in the main php.ini, but Plesk seems to ignore it. Even if it is set in the configuration panel to accept the php.ini setting as standard. The PHP handler works as Apache-Modul. – leopold Mar 04 '15 at 11:29
  • Apache Module (mod_php) ignores php.ini, switch handler to FastCGI. – Oleg Neumyvakin Mar 05 '15 at 10:52
  • Thanks and sorry for my late reply. You have helped me a lot and I appreciate your fast response. I decided to move away from Plesk. I figured that for my purposes this system would mean more fiddling than tweaking :) – leopold Mar 17 '15 at 11:52
  • You are welcome. Yes, Plesk is quite hard for hosting single site of single owner. I believe it's great for commercial using for multi-owners and resellers. – Oleg Neumyvakin Mar 17 '15 at 12:04
  • 1
    Coming from a shared hosting background and wanting something else, this is what I wanted Plesk to use for. But for my use (maybe it comes with more experience in using Plesk) the performance and restriction policies are quite off topic. For me it was more efficient to setup the server by myself without Plesk. – leopold Mar 17 '15 at 14:44