hello i am new on composer mongodb, now i am installing mongodb on my COMMAND PROMPT
but it gives me error message
composer require mongodb/mongodb
error:
Cannot use mongodb/mongodb's latest version 1.13.1 as it requires ext-mongodb ^1.14.0 which is missing from your platform.
In PackageDiscoveryTrait.php line 313:
Package mongodb/mongodb has requirements incompatible with your PHP version, PHP extensions and Composer version:
- mongodb/mongodb 1.13.1 requires ext-mongodb ^1.14.0 but it is not present.
my php version is PHP 8.1.10
i already tried this but it's not working
composer require mongodb/mongodb --ignore-platform-reqs
composer require jenssegers/mongodb --ignore-platform-reqs
message of this it said NO Publishable resource
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^1.13 for mongodb/mongodb
./composer.json has been updated
Running composer update mongodb/mongodb
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
INFO Discovering packages.
jenssegers/mongodb ................................................................................. DONE
laravel/sail ....................................................................................... DONE
laravel/sanctum .................................................................................... DONE
laravel/tinker ..................................................................................... DONE
nesbot/carbon ...................................................................................... DONE
nunomaduro/collision ............................................................................... DONE
nunomaduro/termwind ................................................................................ DONE
spatie/laravel-ignition ............................................................................ DONE
82 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force
INFO No publishable resources for tag [laravel-assets].
No security vulnerability advisories found
CodePudding user response:
You have to enable mongodb extension in your php.ini file.
Locate the php.ini file, open it and add this line: extension = mongodb.so;
The php.ini file is located where your php is installes. For example on Windows it can be C:/php/php.ini