Answer the question
In order to leave comments, you need to log in
Why does [PDOException] Could not find driver occur? ZF2/DoctrineORM?
Hello
I'm trying to run this command from the root of the zf2 project: vendor\bin\doctrine-module orm:validate-schema
The result of the command is:
[Mapping] OK - The mapping files are correct.
[PDOException]
could not find driver
orm:validate-schema
<?php
return array(
'doctrine' => array(
'connection' => array(
'orm_default' => array(
'driverClass' =>'Doctrine\DBAL\Driver\PDOMySql\Driver',
'params' => array(
'host' => 'localhost',
'port' => '3306',
'user' => 'root',
'password' => '',
'dbname' => 'ZF2_Test',
)
)
),
),
);
extension=php_pdo_mysql.dll
in the php.ini file. I have it connected in Php.ini + phpinfo() shows that PDO is enabled. Answer the question
In order to leave comments, you need to log in
Most likely you did not connect the module for the cli environment (although this is strange), it has its own php.ini. Check just in case.
I will describe what helped me with this error.
My situation: I need php-fpm, ubuntu 10 is installed, there is no php5-fpm in apt repositories (in 14 there is, but there is 5.5.9, which is also not ice), there is an option to add a third-party repository, but I decided to collect from the sources. Ended up with a similar problem with pdo -could not find driver . (There is a suspicion that something was not configured correctly during the build.) A banal installation from apt-get php5-mysql helped .
As far as I understand there is no solution?
PDO support => enabled
PDO drivers => mysql, pgsql, sqlite
PDO Driver for MySQL => enabled
PDO Driver for PostgreSQL => enabled
PDO Driver for SQLite 3.x => enabled
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question