错误>使用 yii2 + mongodb 登录或注册时会出错。
完成了与yii2的MongoDB连接。请帮我解决这个问题。
主local.php
return [
'components' => [
'mongodb' => [
'class' => '\yii\mongodb\Connection',
'dsn' => 'mongodb://sameer:27017/demo',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'useFileTransport' => true,
],
],
];
main.php
return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => false,
],
],
];
答案 0 :(得分:0)
检查您的供应商\ yiisoft \ extension.php 我安装了一个将不正确的配置数组添加到文件vendor \ yiisoft \ extension.php
的软件包后,我遇到了同样的错误'tigrov/yii2-country' =>
array (
'name' => 'tigrov/yii2-country',
'version' => '9999999-dev',
'alias' =>
array (
'@tigrov/country' => $vendorDir . '/tigrov/yii2-country/src',
),
'bootstrap' => 'tigrov\\country\\Bootstrap',
),
我已经将前一个更改为下一个(仅包装在数组中的bootstrap)
'tigrov/yii2-country' =>
array (
'name' => 'tigrov/yii2-country',
'version' => '9999999-dev',
'alias' =>
array (
'@tigrov/country' => $vendorDir . '/tigrov/yii2-country/src',
),
array(
'bootstrap' => 'tigrov\\country\\Bootstrap',
)
),