I am trying to update doctrine schema after installation FOSUser Bundle 2.0 but I keep getting this error:
In ArrayNode.php line 238:
The child node "db_driver" at path "fos_user" must be configured.
File config.yaml is configurated propertly in location /config/config.yaml:
framework:
translator: ~
fos_user:
db_driver: orm
firewall_name: main
user_class: Entity\User
from_email:
address: "%mailer_user%"
sender_name: "%mailer_user%"
I tried to solve it via official tutorial: http://symfony.com/doc/master/bundles/FOSUserBundle/index.html#prerequisites
I tried to do step 5 first and than rerun step 1. But still the same error.
Any ideas?
In symfony 4.x you need to create a bundle_name.yaml file instead of config.yaml So, in this case create file fos_user.yaml in config/packages folder. In that file you place the configuration for FOSUserBundle, like so:
fos_user:
db_driver: orm
firewall_name: main
user_class: Entity\User
from_email:
address: '%env(resolve:USER_ADDRESS)%'
sender_name: '%env(resolve:SENDER_NAME)%'
framework:
templating:
engines: ['twig', 'php']
Of course, defining the address and sender_name in .env file as constants or provide them directly with: "%mailer_user%"
use composer require friendsofsymfony/user-bundle dev-master
or go to their packagist page and get the latest version FOSUserBundle Packagist
That should make it install without errors.
If you need to figure out what has changed between symfony version 3.x and 4.x i suggest checking out this article: Configuration Structure - taken from symfony blog A new way to develop applications
try to indent like this:
fos_user:
db_driver: orm
firewall_name: main
user_class: Entity\User
from_email:
address: "%mailer_user%"
sender_name: "%mailer_user%"
Because yml file needs to be written and indent well with all spaces necessary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With