How can i install Mongodb-odm-bundle with Symfony 5.1? - php

Here are the errors that I get when i type :
composer require 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 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.
- 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].
- Installation request for doctrine/mongodb-odm-bundle ^4.2.0 -> satisfiable by doctrine/mongodb-odm-bundle[4.2.0].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/7.4/php.ini
- /usr/local/etc/php/7.4/conf.d/ext-opcache.ini
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.

You need install extension mongodb. If you using ubuntu you can try command below:
sudo apt install php7.4-mongodb
Hope it's help you.

Related

Can not install doctrine/mongodb-odm-bundle

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
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
So, lets go https://docs.mongodb.com/drivers/php#installation :)

Composer install mongo db version problem

I want to install a package using composer for my PHP project.
I tried this first:
composer require jenssegers/mongodb --ignore-platform-reqs
But it doesn't work with this method. Therefore, I removed the mongodb and after install again.
But it doesn't work this method.
composer install
Problem 1
- Installation request for mongodb/mongodb 1.4.2 -> satisfiable by mongodb/mongodb[1.4.2].
- mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
Problem 2
- mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system.
- jenssegers/mongodb v3.5.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.4.2].
- Installation request for jenssegers/mongodb v3.5.0 -> satisfiable by jenssegers/mongodb[v3.5.0].

Installing MongoDB Extension for usage in laravel does not work

i installed the mongoDB extension in my php.ini aswell but it still gives the following error, can someone help?
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
- mongodb/mongodb 1.1.2 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.1.1 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.1.0 requires ext-mongodb ^1.2.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.5 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.4 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.3 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.2 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your syst
em.
- jenssegers/mongodb v3.2.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1, 1.0.2, 1
.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2].
- Installation request for jenssegers/mongodb 3.2.* -> satisfiable by jenssegers/mongodb[v3.2.0].
To enable extensions, verify that they are enabled in your .ini files:
- C:\Program Files (x86)\iis express\PHP\v5.5\php.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.
It seems like you did not have the correct MongoDB extension installed.
Depends on the OS your app is running, you can install MongoDB extension accordingly. http://php.net/manual/en/mongodb.installation.php

Doctrine Installation with composer not working

When I try to install the Doctrine MongoDB ODM library and its dependencies with Composer using the following command:
composer require "doctrine/mongodb-odm=~1.0.0-BETA10#dev"
I get the following:
PHP Warning: Module 'mongo' already loaded in Unknown on line 0
./composer.json has been updated
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
- doctrine/mongodb-odm 1.0.0-BETA10 requires doctrine/mongodb >=1.1.5,<2.0
-> satisfiable by doctrine/mongodb[1.1.5, 1.1.6].
- doctrine/mongodb-odm 1.0.0-BETA11 requires doctrine/mongodb >=1.1.5,<2.0
-> satisfiable by doctrine/mongodb[1.1.5, 1.1.6].
- doctrine/mongodb-odm 1.0.x-dev requires doctrine/mongodb >=1.1.5,<2.0
-> satisfiable by doctrine/mongodb[1.1.5, 1.1.6].
- doctrine/mongodb 1.1.6 requires ext-mongo >=1.2.12,<1.6-dev
-> the requested PHP extension mongo has the wrong version (1.6.0-dev) installed.
- doctrine/mongodb 1.1.5 requires ext-mongo >=1.2.12,<1.6-dev
-> the requested PHP extension mongo has the wrong version (1.6.0-dev) installed.
- Installation request for doctrine/mongodb-odm ~1.0.0-BETA10#dev
-> satisfiable by doctrine/mongodb-odm[1.0.0-BETA10, 1.0.0-BETA11, 1.0.x-dev].
Installation failed, reverting ./composer.json to its original content.
My mongo php extension version is 1.6.0 dev.
I am a noob, please help me with this.

Can't install doctrine/mongodb-odm using Composer

Trying to install doctrine/mongodb-odm via Composer I get this:
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
- doctrine/mongodb 1.0.x-dev requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.2 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.1 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.0-BETA3 requires ext-mongo >=1.3.1,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.0-BETA2 requires ext-mongo >=1.2.12,<1.3-dev -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.0-BETA1 requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.0.0 requires ext-mongo >=1.2.12,<1.4-dev -> the requested PHP extension mongo is missing from your system.
- Installation request for doctrine/mongodb 1.0.*#dev -> satisfiable by doctrine/mongodb 1.0.0, doctrine/mongodb 1.0.0-BETA1, doctrine/mongodb 1.0.0-BETA2, doctrine/mongodb 1.0.0-BETA3, doctrine/mongodb 1.0.1, doctrine/mongodb 1.0.2, doctrine/mongodb 1.0.x-dev.
However php -m has:
[PHP Modules]
...
mongo
...
And composer.phar show --platform has:
...
ext-mongo 1.3.5 The mongo PHP extension
...
Any ideas? The extension is definitely installed correctly, and Composer even lists it. The version (>=1.2.12,<1.4-dev) meets the requirements as well.
Turns out this was the fault of the Sublime Text 2 Composer plugin. If I run Coomposer via Terminal it's fine. Why it doesn't work in ST2 is a bit of a mystery though, as far as I can tell it's executing exactly the same command: /bin/composer.phar update -n -v.
If you loaded Mongo into an instance of PHP installed via WAMPSERVER, a likely cause for this issue is that only one of the 2 php.ini files was modified path\to\wamp\bin\php\php5\php.ini. If you add the extension=php_mongo.dll to the path\to\wamp\bin\apache\apche2\bin\php.ini you should be able to execute php with mongo functions from the command line or editer cli tools.
If you run into composer error:
doctrine/mongodb 1.0.x-dev requires ext-mongo >=1.2.12,<1.5-dev -> the requested PHP extension mongo is missing from your system
then it's another indicator you need to update the apache2x\bin\php.ini file

Categories