从 CPanel 移动到 Plesk 后无法包含文件
我有一组基本文件,其中包含许多其他文件。这使得我在进行更改时不必更新大量文件。问题是,在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,使用绝对路径。
您可以创建一个
$yourLibPath = 'domain/httpdocs/base_data/';
然后使用此变量包含所有库:
Yes use ABSOLUTE path.
you can make a
$yourLibPath = 'domain/httpdocs/base_data/';
And then include all your libs using this var:
设法通过覆盖 vhost.conf 文件中的 open_basedir 路径来解决这个问题。
Managed to sort this out by overriding the open_basedir path in a vhost.conf file.