Failed to install mongodb in yii2 in windows7

I just added this code in app \ common \ config \ main.php

<?php
return [
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
'components' => [
    'cache' => [
        'class' => 'yii\caching\FileCache',
    ],
],

'modules' => [
//...
'gii1' => [
    'class' => 'yii\gii\Module',
        'generators' => [
            'mongoDbModel' => [
                'class' => 'yii\mongodb\gii\model\Generator'
                ]
                    ],
                        ],
                            ],

];

but when I run php composer.phar, require --prefer-dist yiisoft / yii2-mongodb the result came like this enter image description here

what should I do?

+4
source share
1 answer

Check if there is a line

extension=php_mongo.dll

in your php.ini file with no comments (no ;at the beginning). Also check if there is another php.ini with the same (usually there are two configurations: one for CGI and one for CLI).

If you cannot find this, you need to install the MongoDB PHP driver first.

0
source

Source: https://habr.com/ru/post/1650745/


All Articles