yii2 migration command gives warning how to fix it

2019-09-20 14:50发布

问题:

I want to download and use thyseus/yii2-message. followed steps on github. for installation

1) $ composer require thyseus/yii2-message
2) $ php yii migrate/up --migrationPath=@vendor/thyseus/yii2-message/migrations

warning

PHP Warning:  Module 'openssl' already loaded in Unknown on line 0

Warning: Module 'openssl' already loaded in Unknown on line 0
Exception 'yii\base\InvalidConfigException' with message 'The configuration for
the "user" component must contain a "class" element.'

in C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\di\ServiceLocator.php:204

Stack trace:
#0 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\di\ServiceLocator.php(260):
yii\di\ServiceLocator->set('user', Array)
#1 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Component.php(172): yii
\di\ServiceLocator->setComponents(Array)
#2 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\BaseYii.php(529): yii\base\C
omponent->__set('components', Array)
#3 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Object.php(105): yii\Ba
seYii::configure(Object(yii\console\Application), Array)
#4 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\base\Application.php(205): y
ii\base\Object->__construct(Array)
#5 C:\xampp\htdocs\yii2-my-app2\vendor\yiisoft\yii2\console\Application.php(89):
 yii\base\Application->__construct(Array)
#6 C:\xampp\htdocs\yii2-my-app2\yii(26): yii\console\Application->__construct(Ar
ray)
#7 {main}
PHP Core Warning 'yii\base\ErrorException' with message 'Module 'openssl' alread
y loaded'

in .\Unknown:0

Stack trace:
#0 [internal function]: yii\base\ErrorHandler->handleFatalError()
#1 {main}

1st command runs successfully but second command gives some warning I didnt get it? can anyone fix it? and I also want to know what does this migration command exactly do

回答1:

For the warning, check answers to this question. For the error: Yii2-user or another user extension has to be installed first and working.



标签: yii2