Can not install doctrine/mongodb-odm-bundle - php

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 :)

Related

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

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.

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

Mongodb-odm composer request

I have a problem with requesting my composer for mongodb-odm by command: composer request doctrine/mongodb-odm. Every time I run this command I get an error message saying:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb 1.2.1 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.0 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- Installation request for doctrine/mongodb-odm ^1.0 -> satisfiable by doctrine/mongodb-odm[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php.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.
Now, my problem is that I get this error even though my configuration seems to be fine. I did some research so I know what should be included in php.ini file. So, my php.ini file contains line:
extension="mongo.so"
There are two php.ini files in my Mac, therefore, just for insurance, I put this line even into the other one. No change.
I am using MacBook Pro (13-inch, Mid 2012) - OS X 10.11.3
Any help will be appreciated.

Error Install Doctrine-odm MongoDb in Symfony

I have few problems with mongoDb and Symfony.
I installed php driver 1.6.12 and I want to install mongoDbBundle
add these lines in my composer.json
{
"require": {
"doctrine/mongodb-odm": "~1.0",
"doctrine/mongodb-odm-bundle": "~3.0"
},
}
and Then
php composer.phar update doctrine/mongodb-odm doctrine/mongodb-odm-bundle
But I Have these error
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1].
- doctrine/mongodb 1.2.1 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.0 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- Installation request for doctrine/mongodb-odm ~1.0 -> satisfiable by doctrine/mongodb-odm[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4].
As you can see, the doctrine/mongodb-odm dependency requires mongo PHP extension to be installed and enabled in your PHP installation.
You can check if you have it by looking into your php.ini file and/or on a page with phpinfo(). If it's not installed/enabled, you have to do it, otherwise you can't install those dependencies.

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.

Categories