Abdelilah Aassou
Abdelilah Aassou

Reputation: 148

Symfony 2 database_driver issue

I'm trying to begin working with Symfony 2, so I started reading and following jobeet tutorial. I have a problem when i try to create the database using this command "php app/console doctrine:database:create", I get this error:

Symfony\Component\Config\Exception\FileLoaderLoadException]
here is no extension able to load the configuration for "database_driver"     (in C:\wamp\www\jobeet\app/config\parameters.yml). Looked for namespace "databas
_driver", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "oc_platform", "ens_jobeet", "
ebug", "acme_demo", "web_profiler", "sensio_distribution" in C:\wamp\www\jobeet\app/config\parameters.yml (which is being imported from "C:\wamp\www\jobee
\app/config\config.yml").

Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
here is no extension able to load the configuration for "database_driver" (in C:\wamp\www\jobeet\app/config\parameters.yml). Looked for namespace "databas
_driver", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "oc_platform", "ens_jobeet", "
ebug", "acme_demo", "web_profiler", "sensio_distribution"

This is my parameters.yml file content:

database_driver: pdo_mysql

database_host: 127.0.0.1
database_port: null
database_name: jobeet
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: ThisTokenIsNotSoSecretChangeIt

If anyone can help me I would be so grateful.

Upvotes: -2

Views: 3728

Answers (1)

DonCallisto
DonCallisto

Reputation: 29912

Your parameters aren't fine. You should add parameters: key as "top level" key as follows

parameters:
  database_driver: pdo_mysql
  database_host: 127.0.0.1
  database_port: null
  database_name: jobeet
  database_user: root
  database_password: null
  mailer_transport: smtp
  mailer_host: 127.0.0.1
  mailer_user: null
  mailer_password: null
  locale: en
  secret: ThisTokenIsNotSoSecretChangeIt

Moreover I can notice that you use root user as db user and you don't require a password: this is, in general, a bad practice.

Finally change secret token

Upvotes: 1

Related Questions