php 尝试安装 FOSUserBundle 但出现错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18913809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 18:27:41  来源:igfitidea点击:

trying to install FOSUserBundle but getting error

phpsymfony

提问by Shakti Patel

trying to install FOSUserBundlebundle from below link How to install 3rd party Bundlesbut getting this error :

尝试从下面的链接安装FOSUserBundle如何安装 3rd 方包但收到此错误:

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

回答by Nicolai Fr?hlich

You have forgotten to add the configuration for FOSUserBundle in your app/config/config.ymlor at least did not provide a value for fos_user.db_driver.

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

You have to configure at least the db_driver , firewall and your user-class otherwise the configuration will throw an InvalidConfigurationException.

您必须至少配置 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

Please see the documentation chapter Step 5: Configure the FOSUserBundle.

请参阅文档章节第 5 步:配置 FOSUserBundle

回答by Jean-Luc Barat

I solve similar error by updating composer : /usr/local/bin/composer self-update. May this help.

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