skip to Main Content

I had this newly installed Yii2 advanced and want to know if anyone of you ever encountered this error after login from the frontend?

What solution did you do to solve this issue?

Below is my composer.json

{
    "name": "yiisoft/yii2-app-advanced",
    "description": "Yii 2 Advanced Project Template",
    "keywords": ["yii2", "framework", "advanced", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=5.6.0",
        "yiisoft/yii2": "~2.0.14",
        "yiisoft/yii2-bootstrap4": "~2.0.0",
        "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0"
    },
    "require-dev": {
        "yiisoft/yii2-debug": "~2.1.0",
        "yiisoft/yii2-gii": "~2.2.0",
        "yiisoft/yii2-faker": "~2.0.0",
        "codeception/codeception": "^4.0",
        "codeception/module-asserts": "^1.0",
        "codeception/module-yii2": "^1.0",
        "codeception/module-filesystem": "^1.0",
        "codeception/verify": "~0.5.0 || ~1.1.0",
        "symfony/browser-kit": ">=2.7 <=4.2.4"
    },
    "config": {
        "process-timeout": 1800,
        "fxp-asset": {
            "enabled": false
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ]
}

2

Answers


  1. It seems that Yii2 is not compatible with PHP version 8.1.
    I had to go back to version 7.4 of PHP in my macbook

    Login or Signup to reply.
  2. it looks like as of php 8.1 you can’t put null values in the class_exists function.
    To fix that issue, in file vendoryiisoftyii2-debugsrcpanelsUserPanel.php replace line 90/91

            if (!is_object($this->filterModel)
                && class_exists($this->filterModel)
    

    with

            if (!is_object($this->filterModel) && $this->filterModel !== null
                && class_exists($this->filterModel)
    

    It’s not good solution because we are editing the source code of yii, but works 🙂
    It is possible that version 2.0.46 of Yii will fix this

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search