Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable

Post Reply
User avatar
myVesta
Site Admin
Posts: 963
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 10 times
Been thanked: 6 times

After upgrading Debian 9 to Debian 10, those errors in phpMyAdmin may start to appear.

Code: Select all

Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable
and

Code: Select all

Warning in ./libraries/plugin_interface.lib.php#551 count(): Parameter must be an array or an object that implements Countable
Solution:

EDIT FILE

Code: Select all

/usr/share/phpmyadmin/libraries/sql.lib.php
FIND:

Code: Select all

(count($analyzed_sql_results['select_expr'] == 1)
REPLACE WITH:

Code: Select all

((count($analyzed_sql_results['select_expr']) == 1)
--

And also:

EDIT FILE

Code: Select all

/usr/share/phpmyadmin/libraries/plugin_interface.lib.php
FIND:

Code: Select all

if ($options != null && count($options) > 0)
REPLACE WITH:

Code: Select all

if (! is_null($options) && count((array)$options) > 0)

Or one-command solution for myVesta users:

Code: Select all

/usr/local/vesta/bin/v-sed "(count(\$analyzed_sql_results['select_expr'] == 1)" "((count(\$analyzed_sql_results['select_expr']) == 1)" '/usr/share/phpmyadmin/libraries/sql.lib.php'
# and also:
/usr/local/vesta/bin/v-sed "if (\$options != null && count(\$options) > 0)" "if (! is_null(\$options) && count((array)\$options) > 0)" '/usr/share/phpmyadmin/libraries/plugin_interface.lib.php'
Post Reply