I had the same error message on Debian 11 after switching from php7.4 to php8.1.
What solved the issue was upgrading phpMyAdmin to the latest version manually.
=======Steps to followed=====
Back up phpMyAdmin
You should back up your current phpMyAdmin folder by renaming it.
$ sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak
Create a new phpMyAdmin folder
$ sudo mkdir /usr/share/phpmyadmin/
Change to the directory
$ cd /usr/share/phpmyadmin/
Download and Extract phpMyAdmin
$ sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz
Now extract
$ sudo tar xzf phpMyAdmin-*-all-languages.tar.gz
Once extracted, list folder
$ ls
You should see a new folder phpMyAdmin-*-all-languages
We want to move the contents of this folder to /usr/share/phpmyadmin
$ sudo mv phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin
Make a copy of /usr/share/phpmyadmin/config.sample.inc.php
$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
Now edit the config.inc.php
$ sudo nano config.inc.php
$cfg['blowfish_secret'] = 'Zbwen/BEAFv:HTbqOROrqakJ;KUMIpV:'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
$ Ctrl+x
/* to save the file */
Go to your site/phpmyadmin
check all error is cleared.
=================================================
YOU MAY ENCOUNTER THIS ERROR MESSAGE ON PHPMYADMIN /INDEX.PHP
IT MAY SAY SOMETHING LIKE:
The $cfg['TempDir'] (/usr/share/phpmyadmin/tmp)
is not accessible.
phpMyAdmin is not able to cache templates and will be slow because of
this.
===SOLUTION==
$ sudo mkdir -p /var/tmp/phpMyAdmin
$ sudo chown www-data:www-data /var/tmp/phpMyAdmin
$ sudo chmod -R 700 /var/tmp/phpMyAdmin
Edit the config.inc.php again
$ sudo nano config.inc.php
add or replace this line
$cfg['TempDir'] = '/var/tmp/phpMyAdmin';
Cleanup --
You can now delete the tar.gz file and the empty folder.
$ sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz
And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.
$ sudo rm -rf /usr/share/phpmyadmin.bak