开发者

Symfony Jobeet Tutorial Day 3, databases.yml error

开发者 https://www.devze.com 2023-01-01 00:13 出处:网络
I\'m new to Symfony and I\'m going through the Jobeet tutorial v1.4 for Doctrine. I am currently stuck on Day 3. I\'ve followed all the

I'm new to Symfony and I'm going through the Jobeet tutorial v1.4 for Doctrine. I am currently stuck on Day 3. I've followed all the instructions on configuring the database and building models and modules; however, when I try to access "http://localhost:8080/frontend_dev.php" I receive the following error:

'Configuration "config/databases.yml" does not 开发者_如何学Goexist or is unreadable.'

My config/databases.yml file looks like this:

all:  
  doctrine:  
  class: sfDoctrineDatabase  
  param:  
    dsn: 'mysql:host=localhost;dbname=jobeet'  
    username: root  
    password: mysecret

Creating the tables and loading the fixtures seem to work fine after checking the database with phpmyadmin. Any help would be appreciated.

Thank you!


I tried what's in the Jobeet from Day 1 to 3 and it works on my local machine, maybe what you have there is some file permission issue that is preventing your symfony to load the config/databases.yml so please change permissions as needed (chmod in linux).

Not sure if this will solve the problem but I think this is worth to try, execute php symfony cc or simply clear the cache folder and load up again your app in the browser, since the config/databases.yml is to be cached as config_databases.yml.php (you can take a look on /cache/frontend/dev/config/)


phpmyadmin? arrggggghhhhhhh =P

Anyway, your identation is wrong.

It should be like this:

all:
  doctrine:
    class:  sfDoctrineDatabase
    param:
      dsn: "mysql:host=localhost;dbname=jobeet"
      username: root
      password: mysecret

As for the error, if you're on a mac, change the permissions using chmod. :-)


If you're stuck on a problem with databases.yml, this symfony databases.yml configuration reference could be useful: www.symfonyreference.com/databases-yml

0

精彩评论

暂无评论...
验证码 换一张
取 消