filectime() [function.filectime]: stat failed for


filectime() [function.filectime]: stat failed for

我在基于Codeigniter的应用程序中遇到此问题。

A PHP Error was encountered
Severity: Warning
Message: filectime() [function.filectime]: stat failed for cache/6485224e8a2979278bc2725ce316d891717dbfad.php
Filename: libraries/Simple_cache.php
Line Number: 57
  • 可能拒绝许可?
  • 你不是不带参数地调用它吗?

在我寻找答案时发现了这个:

如果PHP的整数类型在您的系统上只有32位,filemtime()会在超过2GB的文件上失败,并警告"stat failed"。所有与Stat()相关的命令将显示相同的行为。

作为一种解决方法,您可以调用系统的stat命令来获取文件修改时间:

在FreeBSD: $mtime = exec ('stat -f %m ')。escapeshellarg(路径)美元);

Linux: $mtime = exec ('stat -c %Y ')。escapeshellarg(路径)美元);

http://board.phpbuilder.com/showthread.php?10379026-RESOLVED-filectime-stat-failed-workaround

从你的错误日志中注意到你正在使用简单缓存库。

您的问题可能是缓存创建为。cache文件,但检查它的行使用。php扩展名。

:

$file_expires = file_exists(APPPATH.'cache/'.$key.'.cache') ? filectime(APPPATH.'cache/'.$key.'.php')+$this->expire_after : (time() - 10);
应:

$file_expires = file_exists(APPPATH.'cache/'.$key.'.cache') ? filectime(APPPATH.'cache/'.$key.'.cache')+$this->expire_after : (time() - 10);

以防别人偶然发现