think
think copied to clipboard
tp5会报错自动删除缓存报错
unlink(...../runtime/cache/f4/197ca1ec1d07bf4facace9aa0ac2f2.php): No such file or directory
建议在thinkphp\libary\think\cache\driver\File.php 300行unlink方法修改为这样 private function unlink($path) { if (file_exists($path)) { return unlink($path); }else{ return true; } // return is_file($path) && unlink($path); }
出现相同问题,改成以上方法是否可解决?
File.php 代码
private function unlink($path)
{
return is_file($path) && unlink($path);
}
加错误抑制符
private function unlink($path)
{
return is_file($path) && @unlink($path);
}
已验证,问题基本解决,不会影响程序的正常执行了