问题描述
我在macOS Mojave上使用最新的php版本7.2,并收到类似
I'm using with latest php version 7.2 on macOS Mojave and receiving error like
$composer require mongodb/mongodb
Using version ^1.4 for mongodb/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
问题1 -mongodb/mongodb v1.4.x-dev需要ext-mongodb ^ 1.5.0->系统中缺少所请求的PHP扩展mongodb. -mongodb/mongodb 1.5.x-dev需要ext-mongodb ^ 1.6->系统中缺少所请求的PHP扩展mongodb. -mongodb/mongodb 1.4.2要求ext-mongodb ^ 1.5.0->系统中缺少所请求的PHP扩展mongodb. -mongodb/mongodb 1.4.1要求ext-mongodb ^ 1.5.0->系统中缺少所请求的PHP扩展mongodb. -mongodb/mongodb 1.4.0要求ext-mongodb ^ 1.5.0->系统中缺少所请求的PHP扩展mongodb. **-mongodb/mongodb ^ 1.4的安装请求-> mongodb/mongodb [1.4.0,1.4.1,1.4.2,1.5.x-dev,v1.4.x-dev]可以满足.
Problem 1 - mongodb/mongodb v1.4.x-dev requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.5.x-dev requires ext-mongodb ^1.6 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system. - mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb is missing from your system. **- Installation request for mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.4.0, 1.4.1, 1.4.2, 1.5.x-dev, v1.4.x-dev].
安装失败,将./composer.json恢复为其原始内容.
Installation failed, reverting ./composer.json to its original content.
我已经安装了mongoDB扩展,但仍然收到问题
I have already installed mongoDB extension still receiving problem
不确定我错过了哪些安装步骤.如果有人可以帮助我解决这个作曲家的问题,我将不胜感激.提前谢谢.
Not sure what I've missed steps to installation. If anyone can help me with this composer problem, I'd greatly appreciate it. in advance Thanks.
推荐答案
composer require mongodb/mongodb --ignore-platform-reqs
composer require jenssegers/mongodb --ignore-platform-reqs
Using version ^3.4 for jenssegers/mongodb
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing mongodb/mongodb (1.4.2): Downloading (100%)
- Installing jenssegers/mongodb (v3.4.5): Downloading (100%)
jenssegers/mongodb suggests installing jenssegers/mongodb-session (Add MongoDB session support to Laravel-MongoDB)
jenssegers/mongodb suggests installing jenssegers/mongodb-sentry (Add Sentry support to Laravel-MongoDB)
Writing lock file
Generating optimized autoload files
composer require jenssegers/mongodb --ignore-platform-reqs
它解决了我的问题.
这篇关于$ Composer找不到mongodb扩展名,必需的mongodb扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!