yii2 migration command gives warning how to fix it? - yii2

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

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

Related

Perch CMS isn't connecting to my XAMPP database

I'm just trying to install Perch CMS into my site locally. At setup, I put in my XAMPP database server host name, username and I leave the password blank because that is how it is meant to be. But it shows me this error code when I try to move forward:
Fatal error: Uncaught Error: Undefined constant "PERCH_DB_PASSWORD" in C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php:46 Stack trace: #0 C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php(46): constant('PERCH_DB_PASSWO...') #1 C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php(75): PerchDB_MySQL->config('PERCH_DB_PASSWO...') #2 C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php(117): PerchDB_MySQL->open_link() #3 C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php(460): PerchDB_MySQL->get_link() #4 C:\xampp\htdocs\dschc\cms\setup\PerchSetup_Installation.class.php(13): PerchDB_MySQL->test_connection() #5 C:\xampp\htdocs\dschc\cms\setup\database\index.php(50): PerchSetup_Installation->test_db(Array) #6 {main} thrown in C:\xampp\htdocs\dschc\cms\core\lib\PerchDB_MySQL.class.php on line 46
P.S I have never changed my database connection credentials since I installed XAMPP

Typo3 Cache Flush Exception - How to debug

I have a dockerized TYPO3 instance on a server and try to flush the typo3 cache manually.
So, I use the following command to do that, inside my docker container:
vendor/.bin/typo3cms cache:flush
However, it fails and returns this error:
[ TYPO3\CMS\Core\Error\Exception ]
Warning: rename(): The first argument to copy() function cannot be a directory in /home/app/vendor/typo3/cms/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2432
How I can debug this and find out what the problem is?
Full stack trace with -vvv
[ TYPO3\CMS\Core\Error\Exception ]
Warning: rename(): The first argument to copy() function cannot be a directory in /home/app/vendor/typo3/cms/typo3/sysext/core/Classes/Utili
ty/GeneralUtility.php line 2432
Exception code: 1
Exception trace:
#0 ()
vendor/helhum/typo3-console/Classes/Console/Error/ErrorHandler.php:86
#1 Helhum\Typo3Console\Error\ErrorHandler->handleError()
#2 rename()
typo3/sysext/core/Classes/Utility/GeneralUtility.php:2432
#3 TYPO3\CMS\Core\Utility\GeneralUtility::flushDirectory()
vendor/helhum/typo3-console/Classes/Compatibility/TYPO3v87/Service/CacheLowLevelCleaner.php:31
#4 Helhum\Typo3Console\TYPO3v87\Service\CacheLowLevelCleaner->forceFlushCachesFiles()
vendor/helhum/typo3-console/Classes/Console/Command/Cache/CacheFlushCommand.php:69
#5 Helhum\Typo3Console\Command\Cache\CacheFlushCommand->execute()
vendor/symfony/console/Command/Command.php:255
#6 Symfony\Component\Console\Command\Command->run()
vendor/symfony/console/Application.php:1000
#7 Symfony\Component\Console\Application->doRunCommand()
vendor/helhum/typo3-console/Classes/Console/Mvc/Cli/Symfony/Application.php:169
#8 Helhum\Typo3Console\Mvc\Cli\Symfony\Application->doRunCommand()
vendor/symfony/console/Application.php:271
#9 Symfony\Component\Console\Application->doRun()
vendor/symfony/console/Application.php:147
#10 Symfony\Component\Console\Application->run()
vendor/helhum/typo3-console/Classes/Console/Core/Kernel.php:148
#11 Helhum\Typo3Console\Core\Kernel->handle()
vendor/helhum/typo3-console/Scripts/typo3-console.php:30
#12 {closure}()
vendor/helhum/typo3-console/Scripts/typo3-console.php:32
#13 require()
vendor/helhum/typo3-console/typo3cms:3
cache:flush [--files-only]
This was a known issue and fixed with version 5.8.6 of the TYPO3 Console.
Well, the question was: How to debug this. Even if the problem is now solved, this may help:
You got the exception trace. You set a breakpoint in GeneralUtility.php line 2432.
If you already have xdebug set up, you only need to start the command line command with appropriate options, e.g with -e for generating debug information.
You can also look at DDEV. The last time I tried it, it worked pretty nicely to get the debugger to run, see https://ddev.readthedocs.io/en/stable/users/step-debugging/
I usually use xdebug in combination with PhpStorm.

Error exporting MySQL table to open document Spreadsheet

I am getting the following error when exporting a MySQL table to open document spreadsheet. My OS is linux Suse. phpMyAdmin version is 4.8.4. Kindly help.
Fatal error: Uncaught Error: Call to undefined function PhpMyAdmin\gzcompress() in /srv/www/htdocs/pma/libraries/classes/ZipExtension.php:224
Stack trace:
#0 /srv/www/htdocs/pma/libraries/classes/OpenDocument.php(175): PhpMyAdmin\ZipExtension-createFile(Array, Array)
#1 /srv/www/htdocs/pma/libraries/classes/Plugins/Export/ExportOds.php(155): PhpMyAdmin\OpenDocument::create('application/vnd...', Array)
#2 /srv/www/htdocs/pma/export.php(504): PhpMyAdmin\Plugins\Export\ExportOds->exportFooter()
#3 {main} thrown in /srv/www/htdocs/pma/libraries/classes/ZipExtension.php on line 224

mediawiki 500 internal error when visit the home page

MediaWiki suddenly came with 500 internal error
Fatal error: Uncaught Error: Call to a member function getCode() on
null in /var/www/wiki/includes/user/User.php:1578 Stack trace: #0
/var/www/wiki/includes/user/User.php(5243): User::getDefaultOptions()
#1 /var/www/wiki/includes/user/User.php(2859): User->loadOptions() #2 /var/www/wiki/includes/context/RequestContext.php(364):
User->getOption('language') #3
/var/www/wiki/includes/Message.php(380): RequestContext->getLanguage()
#4 /var/www/wiki/includes/Message.php(1257): Message->getLanguage() #5 /var/www/wiki/includes/Message.php(842): Message->fetchMessage() #6
/var/www/wiki/includes/Message.php(934): Message->toString('text') #7
/var/www/wiki/includes/exception/MWExceptionRenderer.php(254):
Message->text() #8
/var/www/wiki/includes/exception/MWExceptionRenderer.php(358):
MWExceptionRenderer::msg('dberr-again', 'Try waiting a f...') #9
/var/www/wiki/includes/exception/MWExceptionRenderer.php(52):
MWExceptionRenderer::reportOutageHTML(Object(Wikimedia\Rdbms\DBConnectionError))
#10 /var/www/wiki/includes/exception/MWExce in /var/www/wiki/includes/user/User.php on line 1578
I assume this is a bug that might happen if you have multiple install attempts and the mysql.user is still there. I had the same problem today.
I have filed the bug as:
https://phabricator.wikimedia.org/T177768
the Problem went away after reinstalling with the following steps:
dropping database
removing user from mysql.users
strangely the "user exists" error still appeared on installation
granting access rights was therefore necessary on the mysql database.

Yii2 php yii migration

I just have installed yii2 on linux mint, using xampp, and my php yii migrate doesn't work.
basic # php yii migrate
Yii Migration Tool (based on Yii v2.0.10)
Exception 'yii\db\Exception' with message 'could not find driver'
in /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Connection.php:549
Stack trace:
#0 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Connection.php(863): yii\db\Connection->open()
#1 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Connection.php(850): yii\db\Connection->getMasterPdo()
#2 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Command.php(219): yii\db\Connection->getSlavePdo()
#3 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Command.php(894): yii\db\Command->prepare(true)
#4 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Command.php(362): yii\db\Command->queryInternal('fetchAll', NULL)
#5 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(198): yii\db\Command->queryAll()
#6 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/mysql/Schema.php(97): yii\db\mysql\Schema->findColumns(Object(yii\db\TableSchema))
#7 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/db/Schema.php(147): yii\db\mysql\Schema->loadTableSchema('migration')
#8 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/controllers/MigrateController.php(199): yii\db\Schema->getTableSchema('{{%migration}}', true)
#9 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(771): yii\console\controllers\MigrateController->getMigrationHistory(NULL)
#10 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(135): yii\console\controllers\BaseMigrateController->getNewMigrations()
#11 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#12 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#13 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#14 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('', Array)
#15 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/base/Module.php(454): yii\console\Controller->runAction('', Array)
#16 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#17 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#18 /opt/lampp/htdocs/basic/vendor/yiisoft/yii2/base/Application.php(375): yii\console\Application->handleRequest(Object(yii\console\Request))
#19 /opt/lampp/htdocs/basic/yii(20): yii\base\Application->run()
#20 {main}
you're missing php-mysql or php-mysqlnd
run this
apt-get install php-mysql
update:
there's also a requirements.php file in yii. You might wanna check that out and see exactly what your system is missing. it could be pdo-mysql
either way, check the requirements and a phpinfo(). see what you need and make sure you have it installed and configured propperly
Just like the error message states - there is no database driver installed. Choose your database and install correct driver.
Here is the solution to the problem... yiisitenamne/backend/common/config
look for the php file main-local.php change "localhost -> 127.0.0.1"
Are you using Virtualbox?
Looks like you are missed to install php-mysql
apt-get install php-mysql
then run migration command
php console/yii migrate/up or
php console/yii migrate
I guess this is because of missing driver for PDO. Based on DB you are using, you might want to enable pdo-mysql, pdo-mssql, pdo-postgres ... in your XAMPP php.ini.