Laravel:文件不存在于路径.../cache [英] Laravel: File does not exist at path .../cache
问题描述
完整错误:
Exception has occurred.
Illuminate\Contracts\Filesystem\FileNotFoundException: File does not exist at path D:\Projects\shop\back-end\storage\framework/cache/data/9c/1c/9c1c01dc3ac1445a500251fc34a15d3e75a849df
我尝试了php artisan cache:clear,php artisan config:cache.没有结果.
I tried php artisan cache:clear, php artisan config:cache. No result..
推荐答案
如果使用Cache::has()
访问缓存存储,则这是预期的行为.深度Cache::has()
会尝试访问预期的位置,如果不存在该位置,则会抛出FileNotFoundException
. (源)
If you are accessing your cache store with Cache::has()
this is expected behaviour. Deep down Cache::has()
will try to access the anticipated location and will throw a FileNotFoundException
if the location is not present. (Source)
在Illuminate\Cache\FileStore
中,此异常被捕获并转换为空的有效负载. (源)
In Illuminate\Cache\FileStore
this exception is caught and converted to an empty payload. (Source)
某些调试工具(如XDebug)将在FileNotFoundException
上停止运行,您可以将其视为误报.
Some debugging tools, like XDebug, will halt on the FileNotFoundException
which you can consider a false positive.
这篇关于Laravel:文件不存在于路径.../cache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!