Symfony FOS user bundle initiation
Asked Answered
F

2

19

I have a problem with installing FOS user bundle. I tried to search it everywhere, but probably I'm too dumb and can't find it.

I've created an entity called Admin and tried to run doctrine:schema:update --force I've got an error: The child node "from_email" at path "fos_user" must be configured.

Here is my config.yml fos part.

fos_user:
    db_driver: orm # other valid values are 'mongodb' and 'couchdb'
    firewall_name: main
    user_class: AppBundle\Entity\Admin

any suggestions?

Fetiparous answered 7/2, 2017 at 17:46 Comment(4)
Possible duplicate of trying to install FOSUserBundle but getting errorAccelerate
Seen this question before and didn't find solution there :( I've tried to add node "from_email" with nodes "address" and "name" with values from fos docs but it still didn't work.Fetiparous
How did your config look like when you added them? What error did you get then?Subfloor
The child node "from_email" at path "fos_user" must be configured.Nesline
J
51

in your config.yml add from_email at path "fos_user":

# ...
fos_user:
    db_driver: orm # other valid values are 'mongodb' and 'couchdb'
    firewall_name: main
    user_class: AppBundle\Entity\Admin
    # ...
    from_email:
        address: [email protected]
        sender_name: You
# ...

More info : Step 5: Configure the FOSUserBundle

Jueta answered 7/2, 2017 at 18:15 Comment(1)
Wow, thanks. I was using the recommended dev-master branch on fos and entered in panic mode when I saw the red line message...Baughman
L
1

In your config.yml add from_email at path "fos_user":

fos_user:
  db_driver:      orm # can be orm or odm
  firewall_name:  main
  user_class:     Sonata\UserBundle\Entity\BaseUser
  from_email:
    address: "%mailer_host%"
    sender_name: "%mailer_user%"

and you get those values from parameters.yml file

# This file is auto-generated during the composer install
parameters:

    mailer_host: 127.0.0.1
    mailer_user: "mailer_user"
Laspisa answered 2/11, 2018 at 10:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.