尝试安装FOSUserBundle但收到错误

时间:2013-09-20 09:53:27

标签: php symfony

尝试从链接How to install 3rd party Bundles下方安装 FOSUserBundle 捆绑包但收到此错误:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]  
  The child node "db_driver" at path "fos_user" must be configured. 

2 个答案:

答案 0 :(得分:58)

您忘记在app/config/config.yml中添加FOSUserBundle的配置,或者至少没有为fos_user.db_driver提供值。

您必须至少配置db_driver,防火墙和用户类,否则配置将抛出InvalidConfigurationException

# app/config/config.yml
fos_user:
    db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
    firewall_name: main
    user_class: Acme\UserBundle\Entity\User

请参阅文档章节Step 5: Configure the FOSUserBundle

答案 1 :(得分:0)

我通过更新作曲家来解决类似的错误:/usr/local/bin/composer self-update。  愿这有帮助。