laravel-mongodb: Composer can't find mongodb extension
Hi - I’m running into essentially the same error as in issue #780 when executing composer require jenssegers/mongodb
:
$ 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 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].
To enable extensions, verify that they are enabled in those .ini files:
- C:\Program Files\PHP\v7.0\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.
I’m running Windows 10 and PHP 7. I installed the mongodb extension (php_mongodb.dll in PHP ext/ folder), and I’ve updated php.ini with extension=php_mongodb.dll
. Not sure what I’ve missed. If anyone can help me with this, I’d greatly appreciate it. Thanks.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 40 (1 by maintainers)
composer require jenssegers/mongodb --ignore-platform-reqs
It solved my problem.Or another thing - pecl installing mongodb.so (if we talking about *nix OSes) but putting to mongo.ini:
extension=mongo.so
but have toextension=mongodb.so
If you fix this string at:/etc/php5/mods-available/mongo.ini
all have to be ok. Please, ping me if it fix.@Criscros, try to look:
php -m
to see than extenstsion is installedphp -i | grep mongo
will show you where mongodb ini file locatedextension=mongo.so
if exists toextension=mongodb.so
I executed following commands in order (ubuntu 16.04) (php 7.2)
sudo apt-get install php-mongodb
composer require mongodb/mongodb
composer require jenssegers/mongodb
This worked for me…
sudo pecl install mongodb
sudo nano /etc/php5/mods-available/mongodb.ini
insert in fileextension=mongodb.so
sudo ln -sv /etc/php5/mods-available/mongodb.ini /etc/php5/apache2/conf.d/20-mongodb.ini
sudo ln -sv /etc/php5/mods-available/mongodb.ini /etc/php5/cli/conf.d/20-mongodb.ini
sudo service apache2 restart
composer require jenssegers/mongodb
I just needed to install the php driver for mongo
brew install php56-mongodb
try this
composer install --ignore-platform-reqs
Make sure mongodb version/type is correct I use this
Try installing the mongodb extension using homebrew. Change this commands to your php version.
$ brew tap homebrew/php $ brew install php56-mongodb
Then link it to your php.ini
extension=‘/usr/local/opt/php56-mongodb/mongodb.so’
Use alpha release v4
composer update --ignore-platform-reqs
I’m using php 5.6, so it helped me
sudo apt-get install -y php-pear php5.6-dev sudo pecl install mongo
sudo sh -c “echo ‘extension=mongo.so’ > /etc/php/5.6/mods-available/mongo.ini” sudo ln -s /etc/php/5.6/mods-available/mongo.ini /etc/php/5.6/apache2/conf.d/mongo.ini
sudo service apache2 restart
Thank you all: @Siphion01 and @supaheckafresh. It’s pleasure for me to be helpful.
Have the same problem but on Ubuntu (Homestead). At searching…