我的PHP版本是7.4.3,还配置并启用了APCu扩展。我在Symfony 4应用程序中使用Doctrine APCu缓存。现在,每当我尝试清除result、query或metadata缓存时,我都会遇到以下错误。
php bin/console doctrine:cache:clear-result
// Clearing all Result cache entries
[ERROR] No cache entries were deleted. 该问题仅适用于Symfony应用程序。在核心PHP中,apcu_store运行得很好。apcu_store仅在Symfony应用程序的本地主机上返回false。
下面是我的原理配置文件
doctrine.yaml
doctrine:
orm:
metadata_cache_driver: apcu
query_cache_driver: apcu
result_cache_driver: apcu
.....相同的代码可以在我的产品上运行,但不能在本地运行。结果未清除。
发布于 2020-09-08 02:37:33
我不是Symfony中的专业人员,但如果没有删除缓存条目,Symfony可能不会使用它。https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/caching.html
<?php
$query = $em->createQuery('select u from \Entities\User u');
$query->useResultCache(true);您确定要在清除结果之前保存结果吗?从来没有使用过apcu的结果,但它应该可以工作...
也许你可以通过几个例子来提供关于你的配置的更多信息。
干杯。
https://stackoverflow.com/questions/63426167
复制相似问题