so, started using symfony, yesterday, , while following tutorials, ran database one.
after following steps (creating entities , using console commands create tables), it's time persist entities inside tables.
// entity setup $rep = new entity\reparto(); $rep->setdescrizione("standard rep"); $rep->settipo("0"); $rep->setidazienda(0); // db operation $em = $this->getdoctrine()->getmanager(); $em->persist($rep); <-- error here $em->flush(); return new response("saved!");
this controller call;
at line $em->persist($rep)
receive, twice, following exception:
"pdoexception: not find driver"
by removing line, no exceptions thrown, nothing happens
i checked php.ini file (there's one):
i uncommented extension=php_pdo_mysql.dll
php -m
displays both pdo , pdo_mysql
i'm running last version of symfony (3.1) installed composer, both on php 5.5.38, 5.6.18 , 7.0.3, running on windows 10 64-bit.
the whole thing running on dedicated webserver downloaded when create simfony project.
you have multiple versions of php installed on environment.
first, take @ php version used symfony , if pdo mysql driver enabled on it.
to this, easiest way @ symfony debug bar, version specified (3.1.x).
you see version of php , access phpinfo. search on if have line : pdo drivers : mysql
also check config.yml
doctrine: dbal: driver: pdo_mysql
Comments
Post a Comment