dongtigai3875 2015-12-23 20:49
浏览 913
已采纳

Composer - illuminate / redis安装失败,因为不同版本的照明/支持

I created a fresh installation of Lumen for a new project, and I am trying to setup Redis as the Cache/Session driver. Through composer I was able to install Predis with no issues, and then when trying to run:

composer require illuminate/redis

I am getting this error, which is telling me that Composer is being confused since different libraries are asking for different version of illuminate/support, as I understood from this question:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - Can only install one of: illuminate/support[v5.2.0, v5.1.25].
    - illuminate/redis v5.2.0 requires illuminate/support 5.2.* -> satisfiable by illuminate/support[v5.2.0].
    - Installation request for illuminate/redis ^5.2 -> satisfiable by illuminate/redis[v5.2.0].
    - Installation request for illuminate/support == 5.1.25.0 -> satisfiable by illuminate/support[v5.1.25].


Installation failed, reverting ./composer.json to its original content.

Below is my composer.json, which is pretty basic:

{
    "name": "laravel/lumen",
    "description": "The Laravel Lumen Framework.",
    "keywords": ["framework", "laravel", "lumen"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/lumen-framework": "5.1.*",
        "vlucas/phpdotenv": "~1.0",
        "predis/predis": "^1.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "fzaninotto/faker": "~1.0"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/"
        ]
    },
    "autoload-dev": {
        "classmap": [
            "tests/"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

My question is, what am I doing wrong ? , the question linked above suggests manual changes to solve this. but I believe the setup is so basic, I should be doing something wrong here.

  • 写回答

1条回答 默认 最新

  • dongyiluan1718 2015-12-23 21:18
    关注

    I had to edit the composer.json file with the needed version of illuminate/redis; forcing it to use the same version, as follows:

    {
        "name": "laravel/lumen",
        "description": "The Laravel Lumen Framework.",
        "keywords": ["framework", "laravel", "lumen"],
        "license": "MIT",
        "type": "project",
        "require": {
            "php": ">=5.5.9",
            "laravel/lumen-framework": "5.1.*",
            "vlucas/phpdotenv": "~1.0",
            "predis/predis": "^1.0",
            "illuminate/redis" : "5.1.*"
        },
        "require-dev": {
            "phpunit/phpunit": "~4.0",
            "fzaninotto/faker": "~1.0"
        },
        "autoload": {
            "psr-4": {
                "App\\": "app/"
            },
            "classmap": [
                "database/"
            ]
        },
        "autoload-dev": {
            "classmap": [
                "tests/"
            ]
        },
        "config": {
            "preferred-install": "dist"
        }
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格