从CPanel移动到Plesk后无法包含文件

从CPanel移动到Plesk后无法包含文件

问题描述:

I have a base set of files that are included from lots of other files. This saves me having to update lots of files when I made changes. The issues is, in CPanel my directory structure was:

Base: domain/public_html/base_data Subdomain: domain/public_html/subdomain

This meant I could just go back one directory and include the file. Now that I have moved to Plesk it is like this:

Base: domain/httpdocs/base_data Subdomain: domain/subdomains/subdomain/httpdocs/

The problem with this is none of my includes work when I ../../ out of my current sub domain into the base_data one.

Anyone have any ideas how to fix this?

EDIT: Just turned error reporting on and got this open_basedir restriction in effect. File(/var/www/vhosts/domain.com/httpdocs/base_data/index.php) is not within the allowed path(s): (/var/www/vhosts/domain.com/subdomains/rip/httpdocs:/tmp) in /var/www/vhosts/domain.com/subdomains/rip/httpdocs/index.php on line 14

我有许多其他文件中包含的基本文件集。 这使我无需在进行更改时更新大量文件。 问题是,在CPanel中我的目录结构是: p>

Base: domain / public_html / base_data code> Subdomain: domain / public_html / subdomain code > p>

这意味着我可以返回一个目录并包含该文件。 现在我已经转移到Plesk,它是这样的: p>

Base: domain / httpdocs / base_data code> Subdomain: domain / subdomains / subdomain / httpdocs / code> p>

当我将 ../../ code>从我当前的子域中导入base_data时,这个问题都没有包括在内 一个。 p>

任何人都有任何想法如何解决这个问题? p>

编辑:刚刚打开错误报告并且此 open_basedir限制生效 。 文件(/var/www/vhosts/domain.com/httpdocs/base_data/index.php)不在允许的路径中:(/ var / www / vsvs / domain /subdomains / prip / httpdocs:/ tmp)在第14行的/var/www/vhosts/domain.com/subdomains/rip/httpdocs/index.php中 code> p> div>

Yes use ABSOLUTE path.

you can make a $yourLibPath = 'domain/httpdocs/base_data/';

And then include all your libs using this var:

include($yourLibPath.'time.lib.php');

Managed to sort this out by overriding the open_basedir path in a vhost.conf file.