phpmyadmin warning issue

After installing the new php version, i.e. php7, the phpmyadmin will show a warning.


problem

Warning in ./libraries/plugin_interface.lib.php#551 count(): Parameter must be an array or an object that implements Countable Backtrace ./libraries/display_import.lib.php#371: PMA_pluginGetOptions( string ‘Import’, array, ) ./libraries/display_import.lib.php#456: PMA_getHtmlForImportOptionsFormat(array) ./libraries/display_import.lib.php#691: PMA_getHtmlForImport( string ‘5c919e2ed6622’, string ‘database’, string ‘wordpress’, string ”, integer 2097152, array, NULL, NULL, string ”, ) ./db_import.php#43: PMA_getImportDisplay( string ‘database’, string ‘wordpress’, string ”, integer 2097152, )


reason

It can’t use count() or sizeof() with un array type in new php version.


solution

Force parameter to array is easy way to solve this bug

sudo nano /usr/share/phpmyadmin/libraries/plugin_interface.lib.php

locate to line 551 by using ctrl _ (with shift-key)

if ($options != null && count((array)$options) > 0) {