php,如何访问whm上的其他帐户文件?

php,如何访问whm上的其他帐户文件?,php,permissions,root,whm,Php,Permissions,Root,Whm,我正在制作多个电子商务网站。所有站点都连接到一个中央管理站点以获取数据,并使用WHM从单个服务器工作 WHM账户名称:mercan /home/mercan/public\u html/img.php内容: <?php $image=imagecreatefromjpeg('/home/mercan/public_html/images/testimage.jpg'); header('Content-Type: image/jpeg'); imagejpeg($image); //ok

我正在制作多个电子商务网站。所有站点都连接到一个中央管理站点以获取数据,并使用WHM从单个服务器工作

WHM账户名称:mercan

/home/mercan/public\u html/img.php
内容:

<?php
$image=imagecreatefromjpeg('/home/mercan/public_html/images/testimage.jpg');
header('Content-Type: image/jpeg');
imagejpeg($image);
//ok no problem
?>
<?php
$image=imagecreatefromjpeg('/home/apple/public_html/images/otherimage.jpg');
header('Content-Type: image/jpeg');
imagejpeg($image);
// ok no problem
?>
<?php
$image=imagecreatefromjpeg('/home/apple/public_html/images/otherimage.jpg');
// php file in kivi account. 
header('Content-Type: image/jpeg');
imagejpeg($image);
// error not acces this folder.
// i neeed acces other(apple) account folder or files..
?>
WHM账户名称:kivi

/home/kivi/public_html/imgkivi.php
内容:

<?php
$image=imagecreatefromjpeg('/home/mercan/public_html/images/testimage.jpg');
header('Content-Type: image/jpeg');
imagejpeg($image);
//ok no problem
?>
<?php
$image=imagecreatefromjpeg('/home/apple/public_html/images/otherimage.jpg');
header('Content-Type: image/jpeg');
imagejpeg($image);
// ok no problem
?>
<?php
$image=imagecreatefromjpeg('/home/apple/public_html/images/otherimage.jpg');
// php file in kivi account. 
header('Content-Type: image/jpeg');
imagejpeg($image);
// error not acces this folder.
// i neeed acces other(apple) account folder or files..
?>


如何运行
$image=imagecreatefromjpeg('/home/apple/public_html/images/otherimage.jpg')
关于root访问?

至于最后的问题,PHP永远不应该在web可访问的环境中以root访问权限运行。与其以root访问权限运行,为什么不将图像存储在与PHP运行的相同组的公共文件夹中,并读取此组的访问权限?