Laravel从5.4。*到5.5 *更新错误和php版本错误

时间:2019-01-13 14:08:59

标签: php laravel laravel-5

我已经创建了一个版本为5.4。*的laravel项目,并且我希望该项目的版本为5.5。*

我已经编辑了composer.json,但出现此错误。 错误代码: 您的要求无法解决为一组可安装的软件包。

问题1

-laravel / framework v5.5.9需要php> = 7.0->您的PHP版本(5.6.31)不满足该要求。

composer.json代码

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

}

2 个答案:

答案 0 :(得分:3)

将您的PHP版本更新为7.0或更高版本。您可以在此处https://laravel.com/docs/5.5

查看要求

答案 1 :(得分:0)

如果您处于开发环境中,请尝试安装安装新版本的php 。通过安装新版本的xampp,您将获得php的更新版本。
或者,如果您处于生产模式,请转到选择PHP版本并更新它来升级php版本。 >