Warning with phpMyAdmin 4.6.6 on Ubuntu 18.04 using PHP 7.2.24
Warning with phpMyAdmin 4.6.6 on Ubuntu 18.04 using PHP 7.2.24 in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable
The error is caused, as indicated in the warning, in the /usr/share/phpmyadmin/libraries/sql.lib.php
file.
Warning with phpMyAdmin 4.6.6 on Ubuntu 18.04 using PHP 7.2.24 in ./libraries/sql.lib.php#613
count(): Parameter must be an array or an object that implements Countable
Backup the file before editing:
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
Then edit the file using vim text editor or any other text editor you prefer.
sudo vim /usr/share/phpmyadmin/libraries/sql.lib.php
To search for the line use the forward-slash /
followed by the search pattern /(count($analyzed_sql_results
. Once found hit ENTER
and i
to start changing the line. There are two instances of the string in the file so you need to pick the right one. It would probably be easier to go to the line 613 as indicated in the warning by typing :613
in the editor.
The line should change from:
|| (count($analyzed_sql_results['select_expr'] == 1)
to
|| ((count($analyzed_sql_results['select_expr']) == 1)
Once done type :wq!
to save the changes.