phpmysqlubuntuphpmyadminphp-gettext

Ubuntu 20.04 PhpMyAdmin error 500 with php7.0 - caching_sha2_password]


When I am using php version 7.0 with Ubuntu 20.04 and try open: http://localhost/phpmyadmin/ - then: HTTP ERROR 500 appers.

When I try open any other page which connect with database, there appears:

enter image description here enter image description here

When I change php version to 7.4 - everything is working correct (phpmyadnim and pages)

I checked logs on version 7.0 (tail /var/log/apache2/error.log) and there is error:

enter image description here

I tried install :

sudo apt-get install php-mbstring php7.0-mbstring php-gettext

but everytime I do this - I get information : "Unable to locate package php-gettext"

On php version 7.4 everything is ok. But I want to use php version 7.0.

I tried:


Solution

  • When running a PHP version before 7.1.16, or PHP 7.2 before 7.2.4, set MySQL 8 Server's default password plugin to mysql_native_password or else you will see errors similar to The server requested authentication method unknown to the client [caching_sha2_password] even when caching_sha2_password is not used.

    This is because MySQL 8 defaults to caching_sha2_password, a plugin that is not recognized by the older PHP (mysqlnd) releases. Instead, change it by setting default_authentication_plugin=mysql_native_password in my.cnf. The caching_sha2_password plugin will be supported in a future PHP release.

    Source https://www.php.net/manual/en/mysqli.requirements.php