Cenarius
Cenarius

Reputation: 225

php symfony error mongoDB

I have problem with configuration MongoDB Symfony Program doesnt see class \MongoDbBudle\ to I went to Tools -> Composer -> add -> "doctrine/mongodb-odm". I tried to install it but I saw error:

C:\wamp64\bin\php\php7.0.10\php.exe C:\Users\Root\PhpstormProjects\untitled2\composer.phar require doctrine/mongodb-odm:1.2.x-dev -n --no-progress
./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
- Removal request for alcaeus/mongo-php-adapter == 1.1.9999999.9999999-dev
- Removal request for alcaeus/mongo-php-adapter == 9999999-dev
- doctrine/mongodb-odm 1.2.x-dev requires doctrine/mongodb ^1.4.0 -> satisfiable by doctrine/mongodb[1.4.0].
- doctrine/mongodb 1.4.0 requires ext-mongo ^1.5 -> satisfiable by alcaeus/mongo-php-adapter[1.1.x-dev, dev-master].
- Installation request for doctrine/mongodb-odm 1.2.x-dev -> satisfiable by doctrine/mongodb-odm[1.2.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- C:\wamp64\bin\php\php7.0.10\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.

php.ini seems to be ok. I added dynamic extension mongo-dll: http://pastebin.com/bfb34A0s

Please help me how to solve this problem.

Upvotes: 0

Views: 317

Answers (1)

malarzm
malarzm

Reputation: 2966

Using ODM with PHP 7 is a bit trickier than it should, please check if adding

"provide": {
    "ext-mongo": "1.6.14"
}

to your project's composer.json would solve the issue. Otherwise you can see full chapter on how to use ODM with PHP 7 in the official documentation

Upvotes: 1

Related Questions