I'm trying to install the following package on my Laravel installation using composer : jenssegers/mongodb
But when installing, I'm getting the following error :
- jenssegers/mongodb v3.0.0 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.1 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- jenssegers/mongodb v3.0.2 requires mongodb/mongodb ^1.0.0 -> satisfiable by mongodb/mongodb[1.0.0, 1.0.1].
- mongodb/mongodb 1.0.1 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- mongodb/mongodb 1.0.0 requires ext-mongodb ^1.1.0 -> the requested PHP extension mongodb is missing from your system.
- Installation request for jenssegers/mongodb ^3.0 -> satisfiable by jenssegers/mongodb[v3.0.0, v3.0.1, v3.0.2].
The extension is actually listed when I run composer show -p
like that :
ext-mongo 1.6.12 The mongo PHP extension
and it's also enabled correctly when I do php_info() or anything.
I'm also sure that I enabled it in the correct php.ini file.
Actually, I guess that the problem comes from the fact that it should be called mongodb
instead of mongo
.
Is their any fix for this for Windows ?
Thanks.
Okay, so it seems like I was installing the old legacy driver which is not supported.
To clarify things up, there's two available drivers for MongoDB for PHP :
The legacy driver will be identified as mongo
by PHP, while the new one is correctly identified as mongodb
.
I had the same issue and after searching for a while, i can across this solution:
composer require jenssegers/mongodb --ignore-platform-reqs
This ignores all platform requirements and 'force' installs.
Source: Composer can't find mongodb extension
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With