简体   繁体   English

Symfony缓存清除命令不起作用,但是没有缓存

[英]Symfony cache clear command not working but no cache by the way

I run the command 我运行命令

 php app\console cache:clear

And get the fowllowing answer in a local environnement in Windows 并在Windows的本地环境中获得令人沮丧的答案

 [Symfony\Component\Filesystem\Exception\IOException]
 Failed to remove directory "D:\nginx\web\symfony\dev\var\cache\de~\annotations\fd"

I first checked if the weird de~ folder existed and deleted it running : 我首先检查了奇怪的de〜文件夹是否存在,并删除了正在运行的文件夹:

mkdir empty
c:\Windows\System32\Robocopy.exe /MIR empty cache *

which by the way works also to delete too long file names in the cache folder. 顺便说一句,它也可以删除缓存文件夹中的文件名太长。

Then I checked in windows ui the cache folders, I had a previous cache folder in the app directory and now that I updated Symfony using composer (v2.8.7), it appears to be in the var folder. 然后,我在Windows ui中检查了缓存文件夹,在应用程序目录中有一个先前的缓存文件夹,现在我使用composer(v2.8.7)更新了Symfony,它似乎位于var文件夹中。

All those cache folders are empty, but I still get the weird message with that de~ folder that does not exist anymore. 所有这些缓存文件夹都是空的,但是我仍然收到带有不存在的de〜文件夹的奇怪消息。

I know I worked with annotations to improve my entities to create a postgresql database and tables with correct behavior and modified my config file to use entity managers to have more control over which tables tables to create but I don't know if that error comes from there as I use Doctrine annotations in these entities files. 我知道我使用注释来改进我的实体,以创建具有正确行为的Postgresql数据库和表,并修改了配置文件以使用实体管理器来更好地控制要创建的表的表,但是我不知道该错误是否来自在那里,因为我在这些实体文件中使用了Doctrine注释。

Try adding the --no-warmup flag to the cache clear command: 尝试在缓存清除命令中添加--no-warmup标志:

$ php app\console cache:clear --no-warmup

This has negated strange cache errors for me in the past. 过去,这为我消除了奇怪的缓存错误。 Otherwise some wrong permissions are probably being set somewhere. 否则,可能在某处设置了一些错误的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM