0

I have started learn Symfony. After reading the documentation of Symfony I wanted to try make my application. I have already created a mysql database with the some data, but I can't connect to it within doctrine. As i read in the documentation, if i want to import my database into orm, i have to execute this commands:

php app/console doctrine:mapping:import TestBundle yml

php app/console doctrine:generate:entities TestBundle

But i got message

[Symfony\Component\Debug\Exception\UndefinedFunctionException]
Attempted to call function "mysqli_init" from namespace "Doctrine\DBAL\Driver\Mysqli".

I successfully use mysqli in my flat-php application, but can't use in doctrine. Also the data for database connection is correct. Any ideas?

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
John Doe
  • 43
  • 1
  • 7

1 Answers1

0

I propose you to use slightly different configuration:

// app/config/config.yml
imports:
    - { resource: parameters.yml }
... // another configuration here
doctrine:
    dbal:
        driver:   "%database_driver%"

and set your database driver to pdo_mysql:

// src/config/parameters.yml
parameters:
    database_driver: pdo_mysql
Jay
  • 152
  • 3
  • 10
  • Did it. Got this messages: `[Doctrine\DBAL\Exception\DriverException] An exception occured in driver: could not find driver` `[Doctrine\DBAL\Driver\PDOException] could not find driver` `[PDOException] could not find driver` But in phpinfo() i have support of PDO. – John Doe Jan 12 '15 at 14:08
  • @JohnDoe Then i could recommend you to reinstall virtual server. Maybe you'll find easier to use xampp – Jay Jan 12 '15 at 23:46