写入:
( ! ) Zend\ServiceManager\Exception\ServiceNotCreatedException: Service with name "doctrine.driver.orm_default" could not be created. Reason: Drivers must specify a class in /var/www/projects/library2/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 765
添加到 modules.config.php 文件中:
'DoctrineModule',
'DoctrineORMModule',
教义.global.php 的内容:
<?php
use Doctrine\DBAL\Driver\PDOPgSql\Driver;
return [
'doctrine' => [
'connection' => [
'orm_default' => [
'driverClass' => Driver::class,
'params' => [
'host' => 'localhost',
'port' => '5432',
'user' => 'production',
'password' => 'production',
'dbname' => 'library',
]
],
],
],
];
通过 composer 安装 Doctrine
接下来,将DoctrineModule、DoctrineORMModule添加到 modules.config.php 文件中
我的工作配置是教义.global.php。
我希望这可以帮助你