简体   繁体   English

试图在Yii2中更新作曲家

[英]Trying to update composer in Yii2

I want to update the composer: 我想更新作曲家:

but i am getting following errors: 但我得到以下错误:

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].

this is my composer.json: 这是我的composer.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"
        }
    }
}

How can i solve this? 我怎么解决这个问题? Please help. 请帮忙。

It might be related to your php.ini with missing mongo.so extension. 它可能与您的php.ini ,缺少mongo.so扩展名。

Even if you have it enabled already for php in browser, composer uses php.ini for cli. 即使你已经在浏览器中为php启用它,作曲家也会使用php.ini作为cli。 It's different php.ini file . 这是不同的php.ini文件

You can find it via: 你可以通过以下方式找到它

php --ini

There will be something like: 会有类似的东西:

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

Edit this file with sudo: 使用sudo编辑此文件:

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

And complete the extension there (last line should be fine): 并在那里完成扩展(最后一行应该没问题):

extension=mongo.so

Restart php and retry composer install . 重启php并重试composer install

It it works, you're done. 它有效,你已经完成了。 If not, try to follow mongo install guide . 如果没有,请尝试按照mongo安装指南

you must install extention to your php . 你必须安装扩展到您的PHP。 Refer this: http://php.net/manual/ru/mongo.installation.php 请参阅: http//php.net/manual/ru/mongo.installation.php

add extension 添加扩展名

extension=mongo.so

to file /etc/php5/cli/php.ini 提交/etc/php5/cli/php.ini文件

then restart php 然后重启php

sudo service apapche restart

and retry your install compose command 并重试您的安装compose命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM