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

发布于 2024-11-14 00:13:48 字数 639 浏览 3 评论 0原文

我有一组基本文件,其中包含许多其他文件。这使得我在进行更改时不必更新大量文件。问题是,在 CPanel 中我的目录结构是:

Base: domain/public_html/base_data 子域:domain/public_html/subdomain

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

Base: domain/httpdocs/base_data 子域:domain/subdomains/subdomain/httpdocs/

问题在于,当我 ../../ 从当前子域进入基础数据一。

有人知道如何解决这个问题吗?

编辑:刚刚打开错误报告并让此 open_basedir 限制生效。文件(/var/www/vhosts/domain.com/httpdocs/base_data/index.php)不在允许的路径内:(/var/www/vhosts/domain.com/subdomains/rip/httpdocs:/ tmp)位于 /var/www/vhosts/domain.com/subdomains/rip/httpdocs/index.php 第 14 行

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别想她 2024-11-21 00:13:48

是的,使用绝对路径。

您可以创建一个 $yourLibPath = 'domain/httpdocs/base_data/';

然后使用此变量包含所有库:

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

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');
几度春秋 2024-11-21 00:13:48

设法通过覆盖 vhost.conf 文件中的 open_basedir 路径来解决这个问题。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文