doctrine/mongodb

ext-mongo requirement make problems

Closed this issue ยท 8 comments

we have in https://github.com/alcaeus/mongo-php-adapter 's composer.json:

"provide": {
    "ext-mongo": "1.6.13"
},

However, having doctrine/mongodb and alcaeus/mongo-php-adapter as dependency in a project, leads to:

  • doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

tested with PHP 7.0.8 and ext-mongodb

That is due to composer/composer#5030. Please add a composer requirement to ext-mongo to your root composer.json as indicated in the installation instructions. If you have more issues, please open a ticket against alcaeus/mongo-php-adapter as this is not a problem with this library.

I got this error for PHP 5.6.

doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

Do you have the mongo extension installed? if so, which version?

Installing the deprecated MongoDB driver solved the error. The recommended driver did not work for PHP 5.6

The recommended driver is ext-mongodb and replaces ext-mongo, which is now known as the legacy driver. This library has not been rewritten to work with the old driver, hence the requirement to ext-mongo.

@alcaeus In our profiling tool the adapter was up to 3x times slower than the legacy driver (mongoc). Is it a misconfiguration from our side? Do you have information about performance? Thanks in advance

@manuelbcd No, that's to be expected. I've detailed this in alcaeus/mongo-php-adapter#124 (comment), but there's nothing I can do at this time. If you are using MongoDB ODM, you'll have to deal with the drop in performance until we release 2.0 (which builds on ext-mongodb and is expected later this year).

If you are not using Doctrine MongoDB ODM, you should be using mongodb/mongodb instead of doctrine/mongodb ;)

@alcaeus Thanks for your answer. Yes I'm using doctrine mongodb ODM. I will have to wait for the release planned for this year. Are there any chance to get involved with this doctrine release?