application.config.php:
'doctrine' => array(
'connection' => array(
// default connection name
'orm_default' => array(
'driverClass' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver',
'params' => array(
'driver' => 'pdo_pgsql',
'host' => 'localhost',
'port' => '5432',
'user' => 'postgres',
'password' => 'root',
'dbname' => 'thebasee',
)
)
),
'driver' => array(
__NAMESPACE__ . '_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
)
)
)
),
module.config.php:
// Controllers in this module
'controller' => array(
'classes' => array(
'Account/Account' => 'Account\Controller\AccountController'
),
),
'doctrine' => array(
'driver' => array(
'orm_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Entity' => 'orm_driver'
)
),
'odm_driver' => array(
'class' => 'Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver',
'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Document')
),
'odm_default' => array(
'drivers' => array(
__NAMESPACE__ . '\Document' => 'odm_driver'
)
)
)
),
// Routes for this module
'router' => array(
'routes' => array(
'Account' => array(
'type' => 'segment',
'options' => array(
'route' => '/account[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Account/Account',
'action' => 'index',
),
),
),
),
),
// View setup for this module
'view_manager' => array(
'template_path_stack' => array(
'Account' => __DIR__ . '/../view',
),
),
现在,错误是:
“找不到驱动程序”在/var/www/applicationDir/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:36
安装了postgresql的驱动程序(另一个项目工作正常)但是对于MySql inst,并且在轨道中我播种了这个:
/var/www/applicationDir/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(36): PDO-> __ construct('mysql:host = loca ...','postgres','root',Array)
它似乎使用Mysql驱动程序,但为什么,如果我选择Pg ?! 请帮忙。