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.
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.
I'm really confused about installing mongodb in my symfony. I always get this error when the time I refresh my site and I don't know if MAMP is part of this error.
Attempted to load class "DoctrineMongoDBBundle" from namespace "Symfony\Bundle\MongoDBBundle"
In my composer.json. I already add these codes to that file of composer.json.
"doctrine/mongodb-odm": "^1.0",
"doctrine/mongodb-odm-bundle": "^3.0"
but when I update the composer using this composer update. I always get these errors. I don't which one do I need to fix. I already install mongodb.
Problem 1
- doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.5 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.6 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.7 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.0.8 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
- doctrine/mongodb-odm 1.1.2 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
- doctrine/mongodb-odm 1.1.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
- doctrine/mongodb-odm 1.1.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
- doctrine/mongodb 1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
- doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
- doctrine/mongodb 1.2.2 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
- 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, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.1.0, 1.1.1, 1.1.2].
I add my file to MAMP in htdocs folder. Did I miss something about the setup of mongodb to MAMP? or Does the version of symfony matters on these errors?
The important part from composer's output is
doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
which tells you that ext-mongo is missing from your system. Due to that ODM nor its bundle can't be installed thus the error you're seeing as class indeed doesn't exist. You can find ext-mongo's installation guide here.
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.
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.