我正在尝试将2个数据库设置为我的symfony 2.5项目,但是出现了这个错误:
Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'The service definition "doctrine.dbal.default_connection" does not exist.' \services\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass.php on line 48
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The service definition "doctrine.dbal.default_connection" does not exist. in services\vendor\symfony\symfony\src\Symfony\Component\DependencyInjection\ContainerBuilder.php on line 867
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Unable to replace alias "doctrine.dbal.default_connection" with "database_connection"
这是我的学说定义config.yml
doctrine:
dbal:
default_connection: default
connections:
default:
driver: pdo_mysql
host: localhost
port: ~
name: db1
user: root
password: ~
log:
driver: pdo_mysql
host: localhost
port: ~
name: db2
user: root
password: ~
有什么建议吗?
答案 0 :(得分:1)
错误消息Unable to replace alias
在处理多个数据库时提示您的配置中存在拼写错误。
使用此引用仔细检查您的配置:http://symfony.com/doc/current/cookbook/doctrine/multiple_entity_managers.html