简体   繁体   English

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

[英]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.*我创建了一个版本为 5.4.* 的 laravel 项目,我希望项目版本为 5.5.*

I've edited the composer.json but I get this error.我已经编辑了 composer.json 但我收到了这个错误。 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. - laravel/framework v5.5.9 需要 php >=7.0 -> 您的 PHP 版本 (5.6.31) 不满足该要求。

composer.json code 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
    }

} }

Update your PHP version to 7.0 or higher.将您的 PHP 版本更新到 7.0 或更高版本。 You can check the requirements here https://laravel.com/docs/5.5您可以在此处查看要求https://laravel.com/docs/5.5

If you are in a development environment try install ing the new version of php .如果您在开发环境中,请尝试安装新版本的 php By installing the new version of xampp you will get the updated version of php.通过安装新版本的 xampp,您将获得更新版本的 php。
Or if you are in production mode upgrade your php version by going to Select PHP Version and update it.或者,如果您处于生产模式,请通过选择 PHP 版本并更新它来升级您的 php 版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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