phpMyAdmin errors after php7.2 upgrade
After upgrading to php7.2 on Ubuntu 16.04 LTS, phpMyAdmin shows annoying popup warnings when I view tables:
"Some errors have been detected on the server! Please look at the bottom of this window. Ignore All. Ignore."
At the bottom of the window:
"Warning in ./libraries/sql.lib.php#601
count(): Parameter must be an array or an object that implements Countable"
… followed by a long backtrace list.
This problem occurs on various phpMyAdmin 4.x versions including and below 4.5.4.
How do I fix this?
Update – Blowfish error
After upgrading to the newest version of phpMyAdmin (4.7.9), I now get a new error that shows up at the bottom of every page:
"The configuration file now needs a secret passphrase (blowfish_secret)."
How do I fix this?
Best Answer
Manually update phpMyAdmin on Ubuntu
As of writing this, the phpMyAdmin version available in the Ubuntu package manager (4.5.4) does not fully support php7.2, which leads to the annoying count() warning. The solution is to update to the latest phpMyAdmin version, which is 4.7.9 at the time of writing.
The Ubuntu package is behind. There is a phpMyAdmin PPA, but it too is behind:
Fortunately, we can manually upgrade from the older version.
The basic steps are:
These terminal commands should get the job done (use sudo if applicable):
(Optional) Replace the wget line with the latest version or preferred format of your choice. Visit https://www.phpmyadmin.net/downloads/.
Solve the blowfish error message
At this point, you will probably get a blowfish error when you use phpMyAdmin. To resolve this, you should update a specific configuration file:
vendor_config.php
in/usr/share/phpmyadmin/libraries/vendor_config.php
define('CONFIG_DIR', '');
withdefine('CONFIG_DIR', '/etc/phpmyadmin/');
and save the file.When you are done, lines 33-38 of
vendor_config.php
should look something like:At this point, phpMyAdmin may work without errors, but you might need to add additional length to the blowfish_secret configuration string.
/var/lib/phpmyadmin/blowfish_secret.inc.php
.You should see:
$cfg['blowfish_secret']
string, at least 40 characters and even longer might be better (I use a string as long as 100 characters).For example (don't use this, just an example):
At this point, refresh phpMyAdmin (in your browser) and login again. Everything should work properly now.
If desired, you may remove the backup copy of the old phpMyAdmin version with:
Additional Documentation
For reference, the following are excerpts from the official phpMyAdmin documentation about manually updating to the latest version (this is not Ubuntu specific):
And: