php composer require mongodb/mongodb failed

x33g5p2x  于 2023-06-28  发布在  PHP
关注(0)|答案(1)|浏览(158)

在ubuntu 18.04中,用php5.6,php5.6-fpm,nginx,用ubuntu的mongodb

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)
Your requirements could not be resolved to an installable set of packages.

Problem 1
    - mongodb/mongodb 1.4.2 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb has the wrong version (1.4.2) installed.
    - mongodb/mongodb 1.4.1 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb has the wrong version (1.4.2) installed.
    - mongodb/mongodb 1.4.0 requires ext-mongodb ^1.5.0 -> the requested PHP extension mongodb has the wrong version (1.4.2) installed.
    - Installation request for mongodb/mongodb ^1.4 -> satisfiable by mongodb/mongodb[1.4.0, 1.4.1, 1.4.2].
5hcedyr0

5hcedyr01#

遇到同样的问题,我可以用以下方法解决:

composer require "mongodb/mongodb=^1.4.2" --ignore-platform-reqs

相关问题