0

I'm trying to install Zend Framework 2 + Doctrine from this manual and have some problem with PDO driver. Doctrine is trying to connect to my MySQL server and then trying to create schema:

./vendor/bin/doctrine-module orm:schema-tool:create

I have this error:

 [PDOException] could not find driver 

This is my config/autoload/doctrine.local.php:

 return array( 'doctrine' => array( 'connection' => array( 'orm_default' => array( 'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver', 'params' => array( 'driver' => 'pdo_mysql', 'host' => 'localhost', 'port' => '3306', 'user' => 'root', 'password' => 'password', 'dbname' => 'blog', ))))); 

I have PHP 5.3.5 and i have uncommented ;extension=php_pdo_mysql.dll in php.ini, also it wasn't commented. But php -m | grep -i pdo gives me:

PDO

only. I'm know that it should be pdo_mysql too, but i'm trying everything and it isn't appear.

Anyway, PDO driver is works well at my another project on this server, where I'm not using Zend and Doctrine.

2
  • When doing php -m you should see both PDO and pdo_mysql. Since the last one is the adapter. If pdo_mysql isn't listed then the extension is not correctly activated. It's that easy :) Commented Jun 12, 2013 at 7:55
  • @netiul How I should activate extension correctly? There is no manual to install driver, it should be install by default on my server as i understand. Commented Jun 12, 2013 at 9:53

1 Answer 1

2

Ohh yes. I'm just solved a problem. I'm going to this page and thought to find my php.ini files anywhere else perhaps PHP folder - it was one more in "C:\Users\%username%\AppData\Local\VirtualStore\Program Files (x86)\wamp\bin\php\php5.3.5" and there row

;extension=php_pdo_mysql.dll 

weren't uncomment. I'm uncommented it and it works!

Sign up to request clarification or add additional context in comments.

1 Comment

well, I too had same problem but since i am using sqlite i uncommented ;extension=php_pdo_sqlite.dll and i came to know about this error when i added a try catch while connecting sqlite DB in ZF2 stackoverflow.com/questions/13108482/… (i know this is not related to what the question is asked but I am sure this will help someone to quickly find the issue)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.