Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0"

Hi!
I was upgrading my composer and after success update a blank screen appeared with message: Composer detected issues in your platform: Your Composer dependencies require a PHP version “>= 8.2.0”.
I tried to change in the composer.json from "php": ">=7.4.0", to "php": ">= 8.2.0", but the error still persist. My current php version is:

luka@luka-UX310UQK:/var/www/html/blender-new$ php -v
PHP 8.2.12 (cli) (built: Oct 26 2023 17:33:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.12, Copyright (c), by Zend Technologies

That this error is weird enough, all of my yii2 based application show the same blank page with the error.

Can someone help me point out the cause?

You have some dependencies that requires PHP 8.2. Either do not upgrade or first upgrade your PHP to version 8.2. Latest Yii supports PHP 8.2 just fine, so you should be OK

Thanks for your reply @evstevemd , but I’m using PHP 8.2.12 indeed. Any suggestions?

Can you post your composer.json?
The initial unmodified that brought that error?

Also composer version

1 Like

Sure
Composer version 2.5.8 2023-06-09 17:13:21
and my composer.json

{
    "name": "yiisoft/yii2-app-basic",
    "description": "Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "https://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "https://www.yiiframework.com/forum/",
        "wiki": "https://www.yiiframework.com/wiki/",
        "irc": "ircs://irc.libera.chat:6697/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=7.4.0",
        "yiisoft/yii2": "~2.0.45",
        "yiisoft/yii2-bootstrap5": "~2.0.2",
        "yiisoft/yii2-symfonymailer": "^3.0",
        "kartik-v/yii2-grid": "dev-master",
        "kartik-v/yii2-icons": "^1.4",
        "yiisoft/yii2-swiftmailer": "^2.0",
        "kartik-v/yii2-mpdf": "dev-master",
        "tpmanc/yii2-imagick": "^1.0.3",
        "2amigos/qrcode-library": "^3.0",
        "kartik-v/yii2-widget-rating": "dev-master",
        "kartik-v/yii2-ipinfo": "dev-master",
        "kartik-v/yii2-nav-x": "dev-master",
        "kartik-v/yii2-bootstrap5-dropdown": "@dev",
        "2amigos/yii2-gallery-widget": "~1.0",
        "newerton/yii2-fancybox": "^1.0",
        "kartik-v/yii2-widget-select2": "dev-master"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.1.0",
        "yiisoft/yii2-gii": "~2.2.0",
        "yiisoft/yii2-faker": "~2.0.0",
        "phpunit/phpunit": "~9.5.0",
        "codeception/codeception": "^5.0.0 || ^4.0",
        "codeception/lib-innerbrowser": "^4.0 || ^3.0 || ^1.1",
        "codeception/module-asserts": "^3.0 || ^1.1",
        "codeception/module-yii2": "^1.1",
        "codeception/module-filesystem": "^3.0 || ^2.0 || ^1.1",
        "codeception/verify": "^3.0 || ^2.2",
        "symfony/browser-kit": "^6.0 || >=2.7 <=4.2.4"
    },
    "config": {
        "allow-plugins": {
            "yiisoft/yii2-composer" : true
        },
        "process-timeout": 1800,
        "fxp-asset": {
            "enabled": false
        }
    },
    "scripts": {
        "post-install-cmd": [
            "yii\\composer\\Installer::postInstall"
        ],
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject",
            "yii\\composer\\Installer::postInstall"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ]
        },
        "yii\\composer\\Installer::postInstall": {
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ]
}

I overwritten the vendor\ directory from my working remote version and now it works. Still don’t know what went wrong :thinking:

Thanks anyway for showing your support.

Sorry, for late reply. Glad you solved it.
Try copying it, remove vendor and run composer install just to be sure that the problem is gone

If you get the error message again you can ignore the PHP version with the following command.

composer --ignore-platform-req=php update

And get ready for a bump road in case of any incompatibility met along the way