CDbConnection failed to open the DB connection after upgrade PHP


I got problem in Yii Website, It happen after I upgrade my PHP 7.3 to PHP 8.0. Other website is Ok, but not Yii… I use Windows Server, IIS.

Error Message :
CDbConnection failed to open the DB connection
Server 500 error

I already check in php.ini to include :

And do this (It Works)

I already use iisreset on command prompt or recycle the app pools many times.
I can see the phpinfo.php but not the index.php…

is there anything that I should try ? What should I do…

Thank you.

Please post the error log
Make sure you remove any sensitive information first, if any

I change php.ini to show error.
display_errors = On Directive

Screen Shot 2022-01-12 at 14.37.55

There no console error…

I mean Yii’s error log not PHP one

Thanks for reply.

Sorry, I have resolve it.

It because the PHP version is not compatible