PHP 警告:filemtime() [function.filemtime]
我注意到安装 PHP 脚本之一的目录有非常大的 error_log 文件,几乎有 1GB 大小,大部分错误是由第 478 和 479 行编码生成的。 error_log 文件中的错误示例如下:
PHP Warning: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for /home/khan/public_html/folder/ZBall.jar in /home/khan/public_html/folder/index.php on line 478
PHP Warning: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for /home/khan/public_html/folder/ZBall.jar in /home/khan/public_html/folder/index.php on line 479
我有以下编码,第 477 行到 484 行
foreach ($mp3s as $gftkey => $gftrow) {
$ftimes[$gftkey] = array(filemtime($thecurrentdir.$gftrow),$gftrow);
$ftimes2[$gftkey] = filemtime($thecurrentdir.$gftrow);
}
array_multisort($ftimes2,SORT_DESC,$ftimes);
foreach ($ftimes as $readd) {
$newmp3s[] = $readd[1];
}
请帮助我。
谢谢.. :)
I've noticed that the directory on which one of the PHP script is installed have very large error_log file almost of 1GB size, mostly the errors are generated by coding on line 478 and 479.. example of the error from error_log file is below:
PHP Warning: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for /home/khan/public_html/folder/ZBall.jar in /home/khan/public_html/folder/index.php on line 478
PHP Warning: filemtime() [<a href='function.filemtime'>function.filemtime</a>]: stat failed for /home/khan/public_html/folder/ZBall.jar in /home/khan/public_html/folder/index.php on line 479
I have the following coding, line 477 to 484
foreach ($mp3s as $gftkey => $gftrow) {
$ftimes[$gftkey] = array(filemtime($thecurrentdir.$gftrow),$gftrow);
$ftimes2[$gftkey] = filemtime($thecurrentdir.$gftrow);
}
array_multisort($ftimes2,SORT_DESC,$ftimes);
foreach ($ftimes as $readd) {
$newmp3s[] = $readd[1];
}
Please help me on this.
Thanks.. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
stat failed
错误表示文件/home/khan/public_html/games/ZBall.jar
不存在,或者由于以下原因无法读取权限错误。确保该文件存在于 PHP 正在查找的位置,因为这似乎是导致问题的最可能原因。由于它来自数组
$mp3s
,因此请确保该数组包含存在的文件名称,如果不存在则修改它。The
stat failed
error would indicate that the file/home/khan/public_html/games/ZBall.jar
either doesn't exist, or can't be read due to a permission error. Make sure the file exists in the place PHP is looking, as that seems like the most like cause of the problem.Since it comes from the array
$mp3s
, make sure that array contains names of files that exist and modify it if not.在使用该文件进行操作之前询问该文件。检查我的编辑:
ask for the file before doing something with it. checm my edit:
PHP.net 网站上有一个函数可以删除 Windows 上有关
filemtime
源的错误:
http://php.net/manual/tr/function.filemtime.php#100692
There is a function on PHP.net site which removes a bug on Windows about
filemtime
source:
http://php.net/manual/tr/function.filemtime.php#100692