开发者

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

开发者 https://www.devze.com 2023-03-27 09:54 出处:网络
i m having this problem in Codeigniter based applica开发者_Go百科ition. A PHP Error was encountered

i m having this problem in Codeigniter based applica开发者_Go百科ition.

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


  • Probably permission denied?
  • Aren't you calling it without arguments?


Found this in my searching for an answer:

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.

As a workaround, you can call the system's stat command to get the modification time of a file:

On FreeBSD: $mtime = exec ('stat -f %m '. escapeshellarg ($path));

On Linux: $mtime = exec ('stat -c %Y '. escapeshellarg ($path));

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


Late to the party however noticed from your error log that you are using Simple Cache library.

Your issue might be that the cache is create as a .cache file but the line that checks it is using a .php extension.

See:

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

Should be:

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

Just incase anyone else stumbles upon this

0

精彩评论

暂无评论...
验证码 换一张
取 消