无法将Laravel 5.4更新为5.5作曲家

时间:2017-08-31 16:40:34

标签: php laravel composer-php updates

当我尝试从5.4更新Laravel 5.5时,显示错误。

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0",
        "intervention/image": "^2.4",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}

这是我的composer.json文件。 当我使用命令 composer update 时,这就是show。

Problem 1
        - This package requires php >=7.0 but your PHP version (5.6.25) does not satisfy that requirement.
      Problem 2
        - Installation request for laravel/framework 5.5.* -> satisfiable by laravel/framework[v5.5.0].
        - laravel/framework v5.5.0 requires php >=7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
      Problem 3
        - phpunit/phpunit 6.3.0 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.2.4 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.2.3 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.2.2 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.2.1 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.2.0 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.1.4 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.1.3 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.1.2 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.1.1 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.1.0 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.9 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.8 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.7 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.6 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.5 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.4 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.3 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.2 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.13 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.12 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.11 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.10 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.1 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - phpunit/phpunit 6.0.0 requires php ^7.0 -> your PHP version (5.6.25) does not satisfy that requirement.
        - Installation request for phpunit/phpunit ~6.0 -> satisfiable by phpunit/phpunit[6.0.0, 6.0.1, 6.0.10, 6.0.11, 6.0.12, 6.0.13, 6.0.
    2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 6.0.9, 6.1.0, 6.1.1, 6.1.2, 6.1.3, 6.1.4, 6.2.0, 6.2.1, 6.2.2, 6.2.3, 6.2.4, 6.3.0].

我的PHP版本是7.0.10,我使用wamp。

4 个答案:

答案 0 :(得分:3)

您的PHP版本是5.6

This package requires php >=7.0 but your PHP version (5.6.25) does not satisfy that requirement.

因此,将PHP版本更改为PHP 7.0并运行:

composer install

答案 1 :(得分:1)

我过去有类似的问题..这发生在wamp ...使用命令提示符检查你的php版本..有时wamp显示v7但项目在后台继续使用旧版本。 或者在laravel上创建一个显示php版本的路线..它将确认问题是什么。

答案 2 :(得分:0)

尝试使用composer install --ignore-platform-reqs

答案 3 :(得分:0)

您需要删除composer.lock文件&再次运行composer install