You will get this error when you upgrade your PHP 7 to PHP 8 (or even 7.3 to 7.4 or something like that) but keep your old phpmyadmin version. This error can be in any code but in our case it is in phpMyAdmin\libraries\classes\DatabaseInterface.php
file so we need to fix it for phpMyAdmin. We will not fix the code itself because in this case it is not needed.
The solution here is for Laragon. It is a little longer, but easy, Laragon oriented solution so you can better understand how it works. Scroll down to the end to do this manually (faster).
Laragon solution
It is possible that your Laragon came with older phpMyAdmin version. So we will tell Laragon to download the latest one.
Open your {INSTALLATION_PATH}\laragon\etc\apps\phpMyAdmin folder. Just in case, backup this phpMyAdmin folder first. Then delete all files in it so the folder is empty.
Right click the laragon tray icon, then Tools then Quick add and then Configuration…
this will open packages. conf file in your text editor. Find this line :
# phpMyAdmin
phpmyadmin= *******
of course you will see a link to phpmyadmin download page. It will pobably be link to a specific version.
Change it to this (latest version of phpmyadmin) and save the file.
# phpMyAdmin
phpmyadmin=https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.zip
Note: if the second line starts with # you need to delete the # character.
Right click the laragon tray icon again, then Tools then Quick add and then phpmyadmin… and Laragon with automatixally downlaod the latest phpMyAdmin and install it.
Restart Laragon, open yourproject.test/phpmyadmin/ in your browser (your project will be called different than yourproject.test) and phpmyadmin should work.
Manual solution
1. backup and then delete all files in {INSTALLATION_PATH}\laragon\etc\apps\phpMyAdmin folder
2. Download the latest version of phpMyAdmin from https://www.phpmyadmin.net/downloads/
3. Extract the content of downloaded ZIP file into a empty phpMyAdmin folder
4. Restart laragon and phpMyAdmin should work.