【问题标题】:PHP WHY Warning: filemtime(): stat failed forPHP WHY 警告:filemtime(): stat failed for
【发布时间】:2020-04-22 18:52:21
【问题描述】:
Warning: filemtime(): stat failed for includes\img\defaultimg.jpg in

我阅读并研究过,但没有发现任何有用的东西

在 php 手册中只这么说:

If PHP's integer type is only 32 bits on your system, filemtime() will fail on files over 2GB with the warning "stat failed". All stat()-related commands will exhibit the same behavior.

但只是 jpg 900k

这是我的代码在 xammp 中运行良好,但在生产中却不行

  $dirimg="includes/img/";  //this one also throws warning
        $filename = "".$dirimg."".$resultsb['Img'].".jpg";  //the path
        if(file_exists ($filename)){  // exists?
        $timeimg=filemtime($filename);
       $srci="".$dirimg."".$resultsb['Img'].".jpg?=".$timeimg."";   
        }else{$timeimg=filemtime("includes\img\defaultimg.jpg");  //another path, the file does exists
       $srci="includes\img\defaultimg.jpg?=".$timeimg.""; } // 

在各自的路径中都抛出相同的警告,文件退出 btw

图片可见, 但我需要知道 当它被修改以便浏览器刷新它时

【问题讨论】:

    标签: php


    【解决方案1】:

    是斜线哈哈哈,服务器是Linux 所以,它们必须是这样的“includes/img/defaultimg.jpg?=” 而不是 "includes\img\defaultimg.jpg?="
    哈哈

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-30
      • 2018-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多