首页  >  问答  >  正文

您的平台遇到了 Composer 检测到的问题。 PHP 8.1

我的应用程序有问题。当我运行“composer install”时,出现错误“Composer 在您的平台中检测到问题:您的 Composer 依赖项需要 PHP 版本“>= 8.1.0”。 PHP 服务器上有 8.1.3

当我想添加库“vladimir-yuldashev/laravel-queue-rabbitmq”时出现问题

Composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "doctrine/dbal": "^3.3",
        "fabpot/goutte": "^4.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "illuminate/queue": "*",
        "laravel/framework": "^8.75",
        "laravel/sanctum": "^2.11",
        "laravel/tinker": "^2.5",
        "laravel/ui": "^3.4",
        "maatwebsite/excel": "^3.1",
        "vladimir-yuldashev/laravel-queue-rabbitmq": "*"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.4",
        "nunomaduro/collision": "^5.10",
        "phpunit/phpunit": "^9.5.10"
    },
    "autoload": {
        "psr-4": {
            "App\": "app/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r "file_exists('.env') || copy('.env.example', '.env');""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}


P粉833546953P粉833546953369 天前850

全部回复(1)我来回复

  • P粉378890106

    P粉3788901062023-11-07 10:29:21

    PHP 8.1.12 适合我。这是最新更新的版本。如果您有多个 PHP 版本,则启用确切的 8.1.12

    回复
    0
  • 取消回复