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.
php -m
you should see bothPDO
andpdo_mysql
. Since the last one is the adapter. Ifpdo_mysql
isn't listed then the extension is not correctly activated. It's that easy :) – netiul