2

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.

Script47
  • 14,230
  • 4
  • 45
  • 66

4 Answers4

3

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
JGCW
  • 1,509
  • 1
  • 13
  • 25
  • You should probably take into account that a) `composer.lock` exists, b) `composer.json` has been edited manually, and thus, it would be better to run `composer require --update-with-dependencies laravel/framework:^5.5`. What do you think? – localheinz Sep 01 '17 at 20:37
1

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.

mpixelz
  • 53
  • 1
  • 7
  • phpinfo() show PHP Version 5.6.25. In wamp I clicked 7.0.10. How I change cli version. –  Aug 31 '17 at 16:51
  • Include the wamp's PHP executable path in your PATH or run composer like this `C:\Wamp\Path\Php\php.exe composer install` see https://stackoverflow.com/questions/15597067/how-to-run-php-from-windows-command-line?noredirect=1&lq=1 – OsDev Aug 31 '17 at 17:21
  • you need to update your php version for cli. google update php cli for windows and you will find many guides. once that is done, you need to update your wamp php.ini files and then restart wamp. – mpixelz Sep 20 '18 at 07:19
1

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

Raza Mehdi
  • 923
  • 5
  • 7
0

Try composer install --ignore-platform-reqs

ojikobeshi
  • 124
  • 1
  • 3