mardi 4 août 2015

Symfony 2 not loading database config file

I'm new to symfony and im following the book with heroku as host, im trying to flush a object to database with doctrine but im getting the following error:

[2015-08-04 05:23:58] request.CRITICAL: Uncaught PHP Exception PDOException: "SQLSTATE[08006] [7] could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?" at /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php line 40 {"exception":"[object] (PDOException(code: 7): SQLSTATE[08006] [7] could not connect to server: Connection refused\n\tIs the server running on host \"127.0.0.1\" and accepting\n\tTCP/IP connections on port 5432? at /app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40)"} []

I got my configuration files working (i guess):

 parameters.yml
 database_host: host....
 database_port: 5432
 database_name: ddas1mq8intjqt
 database_user: ymmpjzoqbyokbr
 database_password: password.....
 mailer_transport: smtp
 mailer_host: 127.0.0.1
 mailer_user: null
 mailer_password: null
 secret: ThisTokenIsNotSoSecretChangeIt

and my config.yml:

doctrine:
    dbal:
        driver:   pdo_pgsql
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8

I've run the console commands to create the tables from the entity classes and it worked, but creating an object and ->flush seems the problem... don't know if its some server configuration or I've done something wrong.

Thank you

Aucun commentaire:

Enregistrer un commentaire