PHP 权限执行 file_exists 并包含来自同一服务器中不同域目录的操作?

问题描述 投票:0回答:1

我有 2 个域:domainA.com 和 domainb.com 托管在同一服务器、同一用户上;带路径:

/var/hostdata/username/public_html/domain_a/
&
/var/hostdata/username/public_html/domain_b/

现在在domainB中,我尝试在domainA上的PHP文件和XML文件上使用

file_exists, file_get_contents, include
,但都失败了,没有任何错误或警告。

我尝试在两个站点的虚拟主机文件中启用

php_admin_value open_basedir none
,但仍然失败。

这是我的代码

/var/hostdata/username/public_html/domain_b/file.php
,路径正确,所有文件都可用:

echo file_exists('/var/hostdata/username/public_html/domain_a/include.php') ? '1111' : '0000';
echo file_exists('/var/hostdata/username/public_html/domain_a/sitemap.xml') ? '1111' : '0000';
include('/var/hostdata/username/public_html/domain_a/include.php');

全部失败。请帮助我,谢谢。

php vhosts open-basedir
1个回答
0
投票

是的,

php_admin_value open_basedir none
工作完美,我忘记将此设置应用于虚拟主机中的SSL部分,所以它不起作用

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.