作曲家为什么抱怨ext-mongo扩展? [英] Why does composer complain about the ext-mongo extension?

查看:59
本文介绍了作曲家为什么抱怨ext-mongo扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用composer安装doctrine/mongodb-odm-bundle和doctrine/mongodb时,会引发错误.

When I try to install doctrine/mongodb-odm-bundle and doctrine/mongodb with composer it throws an error.

composer require doctrine/mongodb-odm-bundle doctrine/mongodb

Using version ^3.5 for doctrine/mongodb-odm-bundle
Using version ^1.6 for doctrine/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
    - doctrine/mongodb 1.6.3 requires ext-mongo ^1.6.7 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.6.2 requires ext-mongo ^1.6.7 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.6.1 requires ext-mongo ^1.6.7 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.6.0 requires ext-mongo ^1.6.7 -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb ^1.6 -> satisfiable by doctrine/mongodb[1.6.0, 1.6.1, 1.6.2, 1.6.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - 
    - /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-soap.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.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.

我很惊讶看到此错误消息,因为我确实用pecl安装了Mongodb并用一个ini文件启用了它.

I was suprised to see this error message because I did install Mongodb with pecl and enabled it with an ini file.

RUN pecl install mongodb \
    && docker-php-ext-enable mongodb

有人知道如何解决这个问题吗?

Does anyone knows how to solve this?

推荐答案

我认为通过将带有ext-mongo的provide部分添加到composer.json文件中,可以解决此问题

I figured that by adding a provide section with the ext-mongo to the composer.json file the issue was resolved

"provide" : {
    "ext-mongo": "*"
}

似乎完全忽略了php扩展名.

It appears to completely ignore the php extension.

这篇关于作曲家为什么抱怨ext-mongo扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆