dqy006150 2009-12-08 15:12
浏览 19
已采纳

为什么PHP显然存在时不包括我的文件?

Here is the exact problem. I have an autoload function set up with a piece of code that looks like this:

if(file_exists($class_file))
{
    include($class_file);
    return true;
}

However, when $class_file is set to a certain value, I get an include error:

Error String: include(includes/php/utilities/calendar_event_html.utility.php)
[function.include]: failed to open stream: No such file or directory

It works fine for other files and when I step through this code with a debugger it is clear that PHP believes the file exists, but it seems that include does not. Does anyone have an idea of what is going on?

  • 写回答

2条回答 默认 最新

  • douxing6532 2009-12-08 15:19
    关注

    From the manual:

    Note: The check is done using the real UID/GID instead of the effective one. 
    

    This means that the file may exist, but it's possible that it is not accessible by the UID/GID your PHP instance is running with. I suggest you check the permissions to that file.

    Best wishes,
    Fabian

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探