我已经从memcach迁移到了redis。起初,我使用了PECL Redis 3.1.3,一切正常。更新为3.1.5后,我开始收到错误:
未接收的PHP例外 Symfony Component debug exception fatalthrowableerror:"类型错误: 参数1传递给 Symfony Component Compention varter Mapping factory lazyloadingMetadataFactory :: MergeConstraints(((( 必须是 symfony component validator mapping classmetadata,字符串给定, 被称为 /var/www/acme/www/vendor/symfony/symfony/symfony/src/symfony/component/component/validator/mapping/factory/factory/lazyloadingmetavementafactory.php 在第95英寸 /var/www/acme/www/vendor/symfony/symfony/symfony/src/symfony/component/component/validator/mapping/factory/factory/lazyloadingmetavementafactory.php 第120行
我看了看,redis changelog,没有任何线索在两个版本更新后可能出了什么问题。
我的config.yml(仅缓存/redis东西(:
framework:
validation:
cache: validator.mapping.cache.redis
serializer:
cache: serializer.mapping.cache.redis
session:
handler_id: session.handler.redis
doctrine:
orm:
auto_mapping: true
metadata_cache_driver:
type: redis
host: "%redis.ip%"
port: "%redis.port%"
instance_class: Redis
class: RedisCache
query_cache_driver:
type: redis
host: "%redis.ip%"
port: "%redis.port%"
instance_class: Redis
class: RedisCache
result_cache_driver:
type: redis
host: "%redis.ip%"
port: "%redis.port%"
instance_class: Redis
class: RedisCache
services:
serializer.mapping.cache.redis:
class: DoctrineCommonCacheRedisCache
validator.mapping.cache.redis:
class: SymfonyComponentValidatorMappingCacheDoctrineCache
arguments: ['@doctrine.cache.redis']
redis:
class: Redis
calls:
- [ connect, [ '%redis.ip%', '%redis.port%' ]]
doctrine.cache.redis:
class: DoctrineCommonCacheRedisCache
calls:
- [setRedis, ["@redis"]]
session.handler.redis:
class: SymfonyComponentHttpFoundationSessionStorageHandlerNativeSessionHandler
serializer.mapping.cache.memcached:
class: DoctrineCommonCacheMemcachedCache
doctrine_cache:
providers:
redis_cache:
redis:
connection_id: redis
我的Symfony版本是2.8.31。有任何建议吗?
冲洗redis解决问题。
redis-cli flushall