如何加载mongodb捆绑?

时间:2016-12-08 07:06:13

标签: php mongodb symfony

我真的很困惑在我的symfony中安装mongodb。当我刷新我的网站时,我总是得到这个错误,我不知道MAMP是否是这个错误的一部分。

Attempted to load class "DoctrineMongoDBBundle" from namespace "Symfony\Bundle\MongoDBBundle"

在我的composer.json中。我已经将这些代码添加到composer.json的文件中。

"doctrine/mongodb-odm": "^1.0",
"doctrine/mongodb-odm-bundle": "^3.0"

但是当我使用作曲家更新更新作曲家时。我总是得到这些错误。我不需要修复哪一个。我已经安装了mongodb。

Problem 1
    - doctrine/mongodb-odm 1.0.0 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.1 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.2 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.3 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.4 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.5 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.6 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.7 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.0.8 requires doctrine/mongodb ~1.2 -> satisfiable by doctrine/mongodb[1.2.0, 1.2.1, 1.2.2, 1.3.0, 1.4.0].
    - doctrine/mongodb-odm 1.1.2 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - doctrine/mongodb-odm 1.1.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - doctrine/mongodb-odm 1.1.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - doctrine/mongodb 1.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.36) does not satisfy that requirement.
    - doctrine/mongodb 1.3.0 requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.2.2 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.2.1 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.2.0 requires ext-mongo ^1.2.12 -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb-odm ^1.0 -> satisfiable by doctrine/mongodb-odm[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.1.0, 1.1.1, 1.1.2].

我将我的文件添加到htdocs文件夹中的MAMP。我是否想念mongodb到MAMP的设置?或者symfony的版本是否对这些错误很重要?

1 个答案:

答案 0 :(得分:0)

作曲家输出的重要部分是

  

doctrine / mongodb 1.3.0需要ext-mongo ^ 1.5 - >您的系统中缺少所请求的PHP扩展名mongo。

告诉您系统中缺少ext-mongo。由于ODM及其捆绑包无法安装,因此您看到的类错误确实不存在。您可以找到ext-mongo的安装指南here