最近我将我的应用程序从Symfony 3.4升级到Symfony 4.2。我遇到错误告诉连接时读取错误。
这是堆栈跟踪:
at var / cache / dev / ContainerRUEbk9e / …
这可能会有所帮助。之前我的配置曾经是这样的:
snc_redis: clients: default: type: predis alias: default dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" session: type: phpredis alias: session dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" doctrine: type: phpredis alias: doctrine dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" session: client: session prefix: session:main doctrine: metadata_cache: client: doctrine entity_manager: default # the name of your entity_manager connection document_manager: default # the name of your document_manager connection namespace: "%kernel.root_dir%" result_cache: client: doctrine entity_manager: [default, read] # you may specify multiple entity_managers query_cache: client: doctrine entity_manager: default
改为以下
snc_redis: clients: default: type: predis alias: default dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" session: type: predis alias: session dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" doctrine: type: predis alias: doctrine dsn: "%redis_dsn%" options: read_write_timeout: "%redis_read_write_timeout%" session: client: session prefix: session:main doctrine: metadata_cache: client: doctrine entity_manager: default # the name of your entity_manager connection document_manager: default # the name of your document_manager connection namespace: "%kernel.root_dir%" result_cache: client: doctrine entity_manager: [default, read] # you may specify multiple entity_managers query_cache: client: doctrine entity_manager: default
可能会帮助别人。