【问题标题】:Can not install doctrine/mongodb-odm-bundle无法安装学说/mongodb-odm-bundle
【发布时间】:2020-09-25 20:50:51
【问题描述】:

我想安装学说/mongodb,但出现错误:

Using version ^4.2 for doctrine/mongodb-odm-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.1.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/mongodb-odm-bundle 4.2.0 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm-bundle 4.2.1 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm-bundle 4.2.2 requires doctrine/mongodb-odm ^2.0.0 -> satisfiable by doctrine/mongodb-odm[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.1.0, 2.1.1, 2.1.2].
    - doctrine/mongodb-odm 2.1.2 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.1.1 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.1.0 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.6 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.5 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.4 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.3 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.2 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.1 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - doctrine/mongodb-odm 2.0.0 requires ext-mongodb ^1.5 -> the requested PHP extension mongodb is missing from your system.
    - Installation request for doctrine/mongodb-odm-bundle ^4.2 -> satisfiable by doctrine/mongodb-odm-bundle[4.2.0, 4.2.1, 4.2.2].
  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.

我正在使用本教程https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/installation.html#install-the-bundle-with-composer 谢谢 https://www.php.net/manual/en/mongodb.installation.windows.php

【问题讨论】:

  • 您阅读了该错误消息的哪些部分?您尝试过什么来解决这些错误?
  • 嗨,是的,我现在需要最新的学说/mongodb-odm,但我不知道如何编写或解决此问题。我需要知道命令。谢谢

标签: php mongodb symfony composer-php


【解决方案1】:

正如您在输出中看到的那样,composer 尝试安装 doctrine/mongodb-odm-bundle,这取决于 doctrine/mongodb-odm,这需要在您的系统上安装 mongodb 扩展版本 1.5+。

教程中的提示

那么,让我们去https://docs.mongodb.com/drivers/php#installation :)

【讨论】:

  • 您好,抱歉,它不工作。我习惯了Flex。这个命令:composer config extra.symfony.allow-contrib true 之后我曾经作曲家需要学说/mongodb-odm-bundle。但我犯了同样的错误。
  • 你安装并启用了mongodb吗? php --ri mongodb 的输出是什么? @VojtěchJanoušek
  • 您好,感谢您的重播。在 bash 中获取:vjanousek@localhost test]$ php --ri mongodb Extension 'mongodb' 不存在。现在我在 Windows 上创建新项目,我遇到了同样的问题。
  • 您好,我为手册添加了扩展名。看看我的第一条评论:php.net/manual/en/mongodb.installation.windows.php 我得到了相同的错误和新错误:composer 需要学说/mongodb-odm-bundle PHP 警告:PHP 启动:无法加载动态库 'php_mongodb.dll'(试过:C:\ xampp\php\ext\php_mongodb.dll (Uveden├Ż modul nebyl nalezen.)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-27
  • 1970-01-01
  • 2016-09-04
  • 1970-01-01
  • 2014-01-19
  • 2014-08-05
  • 2012-11-29
相关资源
最近更新 更多