-1

I want to install doctrine/mongodb but I get error:

Using version ^4.2 for doctrine/mongodb-odm-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/mongodb-odm-bundle 4.2.0 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm-bundle 4.2.1 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm-bundle 4.2.2 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm 2.1.2 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.1.1 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.1.0 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.6 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.5 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.4 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.3 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.2 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.1 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.0 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for doctrine/mongodb-odm-bundle ^4.2 -> satisfiable by doctrine/mongodb-odm-bundle[4.2.0, 4.2.1, 4.2.2].
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

I am using this tutorial https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/installation.html#install-the-bundle-with-composer Thank you https://www.php.net/manual/en/mongodb.installation.windows.php

1 Answers1

0

As you can see in the output composer tries install doctrine/mongodb-odm-bundle which depends on doctrine/mongodb-odm which requires mongodb extension version 1.5+ installed on your system.

Hint from the tutorial enter image description here

So, lets go https://docs.mongodb.com/drivers/php#installation :)

yTko
  • 175
  • 7
  • Hi, sorr it is not woking. I am used to Flex. This command : composer config extra.symfony.allow-contrib true and after that I used to composer require doctrine/mongodb-odm-bundle. But I ger same error. – Vojtěch Janoušek Sep 26 '20 at 09:24
  • Have you installed and enabled mongodb? What is the output `php --ri mongodb`? @VojtěchJanoušek – yTko Sep 26 '20 at 19:12
  • HI, thank you for your replay. In bash a get: vjanousek@localhost test]$ php --ri mongodb Extension 'mongodb' not present. Now I create new project at windows and I have same issue. – Vojtěch Janoušek Sep 26 '20 at 19:33
  • try this https://www.php.net/manual/en/mongodb.installation.windows.php – yTko Sep 26 '20 at 20:01
  • Hi, I add extension for manual. Look at the first comment form me: https://www.php.net/manual/en/mongodb.installation.windows.php I get same error and new error: composer require doctrine/mongodb-odm-bundle PHP Warning: PHP Startup: Unable to load dynamic library 'php_mongodb.dll' (tried: C:\xampp\php\ext\php_mongodb.dll (Uveden├Ż modul nebyl nalezen.) – Vojtěch Janoušek Sep 26 '20 at 20:19
  • maybe this help https://stackoverflow.com/questions/25075616/php-startup-unable-to-load-dynamic-library-php-mongo-dll – yTko Sep 26 '20 at 20:48