我有一组基本的文件,这些文件包含在许多其他文件中。这使我在进行更改时不必更新大量文件。问题是,在CPanel中,我的目录结构是:
底座:domain/public_html/base_data
子域:domain/public_html/subdomain
这意味着我可以返回一个目录并包含该文件。现在我已经搬到了Plesk,它是这样的:
底座:domain/httpdocs/base_data
子域:domain/subdomains/subdomain/httpdocs/
这方面的问题是,当我将D_5从当前子域中../../
放入base_data子域时,我的包含工作都没有。
有人知道怎么解决这个问题吗?
编辑:刚刚打开错误报告,得到了这个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
是,使用绝对路径。
你可以做一个$yourLibPath = 'domain/httpdocs/base_data/';
然后使用这个var:包含所有的库
include($yourLibPath.'time.lib.php');
通过重写vhost.conf文件中的open_basedir路径来解决此问题。