这是确切的问题.我有一个自动加载功能设置了一段代码,如下所示:
if(file_exists($class_file))
{
include($class_file);
return true;
}
Run Code Online (Sandbox Code Playgroud)
但是,当$class_file
设置为某个值时,我得到一个包含错误:
Error String: include(includes/php/utilities/calendar_event_html.utility.php)
[function.include]: failed to open stream: No such file or directory
Run Code Online (Sandbox Code Playgroud)
它适用于其他文件,当我使用调试器逐步执行此代码时,很明显PHP认为该文件存在,但似乎include
没有.有没有人知道发生了什么?
从手册:
Note: The check is done using the real UID/GID instead of the effective one.
Run Code Online (Sandbox Code Playgroud)
这意味着该文件可能存在,但可能是您的PHP实例正在运行的UID/GID无法访问它.我建议你检查该文件的权限.
祝愿,
费边