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

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 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题