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 '5de53ad1bdb35',
string 'database',
string 'laxie_magento',
string '',
integer 209715200,
array,
NULL,
NULL,
string '',
)
./db_import.php#43: PMA_getImportDisplay(
string 'database',
string 'laxie_magento',
string '',
integer 209715200,
)
./index.php#53: include(./db_import.php)
Getting this error on Import tab of phpMyAdmin and below are the server details
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.7.28-0ubuntu0.18.04.4 – (Ubuntu)
Protocol version: 10
Server charset: UTF-8 Unicode (utf8)
This fixed my issue:
Import/Export issues If you are also getting an error Warning in ./libraries/plugin_interface.lib.php#551 under import and export tabs:
Backup plugin_interface.lib.php
sudo cp /usr/share/phpmyadmin/libraries/plugin_interface.lib.php /usr/share/phpmyadmin/libraries/plugin_interface.lib.php.bak
Edit plugin_interface.lib.php
sudo nano /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
Press CTRL + W
and search for if (! is_null($options) && count($options) > 0) {
If not found, try search for if ($options != null && count($options) > 0)
Replace with if (! is_null($options) && count((array)$options) > 0) {
Save file and exit. (Press CTRL + X
, press Y
and then press ENTER)
Great this worked fine. Although it seems a bit hacky to just cast a empty variable to an array. I’d really like to know, what causes this error. But it’s fine for now. Thanks a bunch @piyush-nath
–
If CTRL + W doesn’t work (SSH in browser or such) you can CTRL + _ and go to line 551.
– Just run this command line in terminal and come back to PhpMyAdmin.
sudo sed -i "s/|\s*\((count($analyzed_sql_results\['select_expr'\]\)/| ()/g" /usr/share/phpmyadmin/libraries/sql.lib.php
source : https://stackoverflow.com/questions/59143117/warning-in-libraries-plugin-interface-lib-php551-count-parameter-must-be-a