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.
Related
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 :)
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.
Every time when i am running "composer require jenssegers/mongodb ^3.0" this command in my command prompt. I am just getting below error can any one suggest. Thanks in advance.
Installation failed, reverting ./composer.json to its original content.
D:\XAMPP\htdocs\library>composer require jenssegers/mongodb
Using version ^3.0 for jenssegers/mongodb
./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
- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable b
y mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable b
y mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable b
y mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP ext
ension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP ext
ension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jensseg
ers/mongodb[v3.0.0, v3.0.1, v3.0.2].
To enable extensions, verify that they are enabled in those .ini files:
- D:\XAMPP\php\php.ini
You can also run php --ini inside terminal to see which files are used by PH
P in CLI mode.
try this
composer require jenssegers/mongodb --ignore-platform-reqs
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.
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