Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Doctrine say it can't find the PDO driver?

I tried Symfony 2 today and I tried to play a bit with Doctrine.

But when I use the command php app/console doctrine:schema:create in the command line, it returns this error:

[PDOException]
could not find driver

doctrine:schema:create [--dump-sql] [--em[="..."]]

My php.ini file and phpinfo() cleary show that the PDO driver is loaded. I also created a little script in pure PHP to connect to my database using PDO and it worked fine. No error, so PDO is well installed and works.

PHP and MySQL are running on my computer using the last version of EasyPHP.

What could have gone wrong with Doctrine? Where should I look now?

like image 344
Marc-François Avatar asked Sep 17 '11 01:09

Marc-François


1 Answers

Yeah, if you type php -m at the command line, it should list both PDO and pdo_mysql. In my case it showed only PDO which is why it could not find the MySQL driver.

As you've already commented, I think it's because the PHP CLI cannot find a suitable php.ini file.

like image 177
Simon East Avatar answered Sep 28 '22 01:09

Simon East