2016-04-13 14 views
0

Symfony3にFOSUserBundleをインストールするとこのエラーが発生します。Symfony 3.0.4でFOSUserBundleをインストールする際のトラブル

[symfonyの\コンポーネント\依存性の注入\例外の\ ServiceNotFoundException] サービス "security.authentication.managerは" "security.user.provider.concrete.fos_userbundle" 存在しないサービスに依存しています。ここ は、あなたが(YAMLの仕様で指定された)は、第2の1がロードされないことを意味し、あなたのsecurity.ymlファイルに2つのprovidersの鍵を持っている私のsecurity.yml

security: 

# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers 
providers: 
    in_memory: 
     memory: ~ 
encoders: 
    FOS\UserBundle\Model\UserInterface: bcrypt 

role_hierarchy: 
    ROLE_ADMIN:  ROLE_USER 
    ROLE_SUPER_ADMIN: ROLE_ADMIN 

providers: 
    fos_userbundle: 
     id: fos_user.user_provider.username 

firewalls: 
    # disables authentication for assets and the profiler, adapt it according to your needs 
    #dev: 
    # pattern: ^/(_(profiler|wdt)|css|images|js)/ 
    # security: false 

    main: 
     anonymous: true 
     pattern: ^/ 
     form_login: 
      provider: fos_userbundle 
      login_path: /login 
      check_path: fos_user_security_check 
      # if you are using Symfony < 2.8, use the following config instead: 
      # csrf_provider: form.csrf_provider 

     logout:  true 
     anonymous: true 
     # activate different ways to authenticate 

     # http_basic: ~ 
     # http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate 

     # form_login: ~ 
     # http://symfony.com/doc/current/cookbook/security/form_login_setup.html 

access_control: 
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } 
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } 
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } 
    - { path: ^/admin/, role: ROLE_ADMIN } 
    - { path: ^/chat, role: ROLE_ADMIN } 
+0

このバンドルはSymfony3の準備ができていないと思います。 "FOSUserBundleはsymfony2でデータベースバックアップされたユーザシステムのサポートを追加しました" – mika

+0

はこのバンドルを今のところ使用できないのですか? –

+0

そうだろう。 Symfony2プロジェクトをまだセットアップしておかなければなりませんか?最新のバージョンにはSymfony 3.0が提供するすべての機能があります。つまり、3.0から3.0.4までの新機能だけを緩和します。 – mika

答えて

0

です。したがって、アプリケーションはFOSUserBundleユーザプロバイダについて何も知らず、インメモリユーザプロバイダのみを認識します。

+0

Ok。ありがとう。それは問題だった.. –

関連する問題