[英]PHP Warning: failed to open stream: no such file or directory
I am working on local server, but I am having problem including files, even with full path given. 我正在本地服务器上工作,但我遇到包括文件在内的问题,即使是给出了完整路径。 eg, I have a file
/home/[user]/public_html/vt/test.php
like this: 例如,我有一个文件
/home/[user]/public_html/vt/test.php
如下所示:
<?php
include_once('/home/<user>/public_html/vt/Menu.php');
print "included_once called.\n";
?>
I got error in error_log
: 我在
error_log
收到错误:
failed to open stream: No such file or directory
/home/[user]/public_html/vt/Menu.php exists, and access right is: /home/[user]/public_html/vt/Menu.php存在,访问权限是:
-rwxr-xr-x. 1 <user> apache 3906 Jul 5 08:43 <full/path/of/the/file>
The local documentRoot folder is set to (recursively): 本地documentRoot文件夹设置为(递归):
drwxr-xr-x. 4 <user> apache 4096 Jul 26 14:06 public_html
So what is wrong? 那有什么不对?
this will help you 这会对你有所帮助
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include "$root/inc/include1.php";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.