"Deprecation Notice" error in PhpMyAdmin with ubuntu 20.04, php8.0
Asked Answered
I

6

12

I'am getting error when i login to phpmyadmin

Deprecation Notice in ./libraries/classes/Di/ReflectorItem.php#82 Method ReflectionParameter::getClass() is deprecated

Backtrace

./libraries/classes/Di/ReflectorItem.php#50: PhpMyAdmin\Di\ReflectorItem->_resolveArgs( array, array, ) ./libraries/classes/Di/FactoryItem.php#27: PhpMyAdmin\Di\ReflectorItem->invoke(array) ./libraries/classes/Di/Container.php#62: PhpMyAdmin\Di\FactoryItem->get(array) ./libraries/classes/Di/AliasItem.php#44: PhpMyAdmin\Di\Container->get( string 'PhpMyAdmin\Controllers\Database\DatabaseStructureController', array, ) ./libraries/classes/Di/Container.php#62: PhpMyAdmin\Di\AliasItem->get(array) ./db_structure.php#35: PhpMyAdmin\Di\Container->get( string 'DatabaseStructureController', array, )

Idaidae answered 16/1, 2021 at 1:43 Comment(0)
D
32

You can also disable notifications and warnings adding this line to config.inc.php:

$cfg['SendErrorReports'] = 'never';

Source: PMA Docs

Daynadays answered 12/8, 2021 at 5:5 Comment(2)
since the question is actually about "deprecation warning" which disturb experience after upgrage php (not error), this part is the correct solution. Since this solution is like "turning off" the warning mesage.Exhaust
This worked for me in ubuntu 20.04. I upgraded my php version from php7.4 to php8.1, after that I faced this error in phpmaydmin. Then I added this line $cfg['SendErrorReports'] = 'never'; to end of this file /etc/phpmyadmin/config.inc.php. It works. ThanksAla
F
7

This is most likely caused by using PHP 8 and PHPMyAdmin < v5 either upgrade you PHPMyAdmin to 5.0 or higher or downgrade your PHP to 7

Flower answered 2/2, 2021 at 22:22 Comment(2)
this is not a solution. I am using php v8 because my application need it.Izanagi
@HarshalLonare upgrade phpMyAdmin to the latest version. It worked for me :)Forepart
F
2

I had the same error. phpMyAdmin 5.1.3 uses PHP 7.1 and phpMyAdmin 4.9.10 uses PHP 5.5 to 7.4 You can see that info here: https://www.phpmyadmin.net/downloads/

I have installed 4.9.5 with apache, so what I did was install PHP7.4 and php7.4-fpm, then I modified the phpMyAdmin apache config file to indicate that it should work with PHP7.4

Install php7.4-fpm:

sudo apt install libapache2-mod-fcgid
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php && sudo apt update
sudo apt install php7.4-fpm
sudo a2enmod actions alias proxy_fcgi fcgid
sudo systemctl restart apache2

Modify phpMyAdmin apache config file:

sudo nano /etc/phpmyadmin/apache.conf 

After Alias /phpmyadmin /usr/share/phpmyadmin paste:

<FilesMatch \.php> # Apache 2.4.10+ can proxy to unix socket
        SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost/"
</FilesMatch>

You can restart apache again and that's it. Good luck!

Fizz answered 20/2, 2022 at 18:53 Comment(2)
With me, the phpMyAdmin apache config file is located at: /etc/apache2/conf-available/phpmyadmin.confManzanares
I don't think this is the solution since this solution suggest to downgrade to php 7. The title already said it uses php8 which is newer.Exhaust
K
0

Because 5.0 series is ended and 5.1 will be out next this will not be fixed. 5.1 has a new DI system and the classes mentioned in the output do not exist anymore. But you can download the latest version in development (phpMyAdmin 5.1+snapshot) and the DI errors should be gone :)

https://github.com/phpmyadmin/phpmyadmin/issues/16268

Keturahkeung answered 14/9, 2021 at 0:20 Comment(0)
D
0

I've got a WAMPSERVER installed and what cleared those notices for me was updating phpmyadmin to 5.1.3 that supported PHP 8

Damage answered 30/3, 2022 at 8:3 Comment(0)
W
0

Install php7.4-fpm and adding the repository ppa:ondrej/php allowed me to use php7.4-fpm instead of trying the php8.0-fpm version on Ubuntu 20.04 Server.

Winniewinnifred answered 6/5 at 7:28 Comment(1)
This looks like an abbreviated version of Mary's answer.Hearn

© 2022 - 2024 — McMap. All rights reserved.