-2

我正在尝试开始使用 Symfony 2,所以我开始阅读并遵循 jobeet 教程。当我尝试使用此命令“php app/console dictionary:database:create”创建数据库时遇到问题,我收到此错误:

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"

这是我的 parameters.yml 文件内容:

数据库驱动程序: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

如果有人可以帮助我,我将不胜感激。

4

1 回答 1

1

你的参数不对。您应该添加参数: key 作为“顶级”键,如下所示

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

此外,我注意到您使用 root 用户作为 db 用户并且不需要密码:这通常是一种不好的做法。

最后更改秘密令牌

于 2015-02-23T11:07:28.630 回答