0
votes

I've installed a MongoDB driver but something is obviously wrong since it doesn't work. This is what I did:

  • sudo pecl install mongodb
  • pecl/mongodb is already installed and is the same as the released version 1.1.7

phpinfo() returns that MongoDB is installed

Also, var_dump(extension_loaded('mongodb')); returns as a true.

When I execute "php composer.phar update" I get the following message:

root@debian:/var/www/html# php composer.phar update Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

Problem 1 - yiisoft/yii2-mongodb 2.0.5 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.4 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.3 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.2 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.1 requires ext-mongo >=1.4.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.0 requires ext-mongo >=1.3.0 -> the requested PHP extension mongo is missing from your system. - yiisoft/yii2-mongodb 2.0.5 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system. - Installation request for yiisoft/yii2-mongodb ^2.0 -> satisfiable by yiisoft/yii2-mongodb[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5].

To enable extensions, verify that they are enabled in those .ini files: - /etc/php5/cli/php.ini - /etc/php5/cli/conf.d/05-opcache.ini - /etc/php5/cli/conf.d/10-pdo.ini - /etc/php5/cli/conf.d/20-curl.ini - /etc/php5/cli/conf.d/20-json.ini - /etc/php5/cli/conf.d/20-mcrypt.ini - /etc/php5/cli/conf.d/20-memcached.ini - /etc/php5/cli/conf.d/20-mysql.ini - /etc/php5/cli/conf.d/20-mysqli.ini - /etc/php5/cli/conf.d/20-pdo_mysql.ini - /etc/php5/cli/conf.d/20-readline.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

Thanks

1

1 Answers

1
votes

ext-mongo is a different extension than ext-mongodb (latter being newer). If Yii2 does not support new one yet then you may try using a polyfill such as alcaeus/mongo-php-adapter