Cannot update Laravel 5.4 to 5.5 composer

*爱你&永不变心* 提交于 2020-01-15 06:25:10

问题


When I tried to update Laravel 5.5 from 5.4, it is show errors.

{
    "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
    }
}

This is my composer.json file. When I use command composer update, this is 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].

My PHP version is 7.0.10 and I use wamp.


回答1:


Your PHP version is 5.6

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

So change your PHP version to PHP 7.0 and run:

composer install



回答2:


i had similar issue in the past.. this happens with wamp.. check your php version using command prompt.. sometimes wamp shows v7 but the project keeps using older version in the background. or create a route on laravel to show php version.. it will confirm what the issue is.




回答3:


Try composer install --ignore-platform-reqs




回答4:


You need to remove composer.lock file & run composer install again



来源:https://stackoverflow.com/questions/45986411/cannot-update-laravel-5-4-to-5-5-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!