尝试在 Yii2 中更新作曲家



我想更新作曲家:

但是我收到以下错误:

Problem 1
    - yiisoft/yii2-mongodb 2.0.4 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
    - yiisoft/yii2-mongodb 2.0.3 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
    - yiisoft/yii2-mongodb 2.0.2 requires ext-mongo >=1.5.0 -> the requested PHP extension mongo is missing from your system.
    - yiisoft/yii2-mongodb 2.0.1 requires ext-mongo >=1.4.0 -> the requested PHP extension mongo is missing from your system.
    - yiisoft/yii2-mongodb 2.0.0 requires ext-mongo >=1.3.0 -> the requested PHP extension mongo is missing from your system.
    - Installation request for yiisoft/yii2-mongodb ~2.0.0 -> satisfiable by yiisoft/yii2-mongodb[2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4].

这是我的作曲家.json:

{
    "name": "yiisoft/yii2-app-advanced",
    "description": "Yii 2 Advanced Project Template",
    "keywords": ["yii2", "framework", "advanced", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.4",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-imagine": "*",
        "2amigos/yii2-ckeditor-widget": "~1.0",
        "2amigos/yii2-tinymce-widget": "~1.1",
        "facebook/php-sdk-v4" : "~5.0",
        "yiisoft/yii2-mongodb": "~2.0.0"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "extra": {
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

我该如何解决这个问题?请帮忙。

它可能

与缺少mongo.so扩展名的php.ini有关。

即使您已经在浏览器中为 php 启用了它,作曲家也会使用 cli 的php.ini这是不同的php.ini文件

您可以通过以下方式找到它:

php --ini

会像这样:

Loaded Configuration File:         /etc/php5/cli/php.ini

使用 sudo 编辑此文件:

sudo nano /etc/php5/cli/php.ini

并在那里完成扩展(最后一行应该没问题(:

extension=mongo.so

重新启动 php 并重试 composer install

它有效,你完成了。如果没有,请尝试遵循 mongo 安装指南。

你必须

在你的php上安装扩展。参考这个: http://php.net/manual/ru/mongo.installation.php

添加扩展名

extension=mongo.so

提交/etc/php5/cli/php.ini

然后重新启动 PHP

sudo service apapche restart

,然后重试安装撰写命令

相关内容

  • 没有找到相关文章

最新更新