Today, I had installed PHP 7.3 and phpMyAdmin on Ubuntu 18.04 LTS system. I am using MariaDB as database server running on the same instance. When I tried to access data in tables using phpMyAdmin got the following error message on screen.
Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
Solution:
It looks issue is due to older version of phpMyAdmin. The version of phpMyAdmin is older before the release of PHP 7.3 and it not properly compatible with that.
In order to resolve, we recommend to upgrade the phpMyAdmin version. But you can make changes in sql.lib.php to temporarily resolve this error.
- Make a backup of sql.lib.php
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
- Next, edit sql.lib.php in your favorite text editor:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
- Press CTRL + W and enter string
(count($analyzed_sql_results['select_expr'] == 1)
to search.Then, replace it with
((count($analyzed_sql_results['select_expr']) == 1)
- Save file and exit. (Press CTRL + X, press Y and then press ENTER).
All done. The error message should disappear now.
7 Comments
It works! Thank you!
Thanks a lot. The error in phpmyadmin is gone. Thanks so much for giving this tutorial and the search shortcut for nano. I don’t think I knew it was possible to search inside nano like that.
Excellent! Worked like a charm!
Version applied to: Version information: 4.7.0
Thank you for the solution!
this work for me also, thanks.
Worked, thank you!
This worked for me! Thanks!