简体   繁体   中英

Laravel from 5.4.* to 5.5* Update error and php version error

I've created a laravel project with version 5.4.* and I want the project version to be 5.5.*

I've edited the composer.json but I get this error. error code: Your requirements could not be resolved to an installable set of packages.

Problem 1

- laravel/framework v5.5.9 requires php >=7.0 -> your PHP version (5.6.31) does not satisfy that requirement.

composer.json code

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.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
    }

}

Update your PHP version to 7.0 or higher. You can check the requirements here https://laravel.com/docs/5.5

If you are in a development environment try install ing the new version of php . By installing the new version of xampp you will get the updated version of php.
Or if you are in production mode upgrade your php version by going to Select PHP Version and update it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM