Phpmyadmin [sql.lib.php] + PHP 7.2 + Ubuntu 18.04 | Fix Bug

When PHP 7.2 comes into market, There are many incompitable scenario can be seen. Meanwhile I meet a situation after installing latest verison of PHP that is 7.2. Installed PHPmyAdmin on my aws server.
After loggin into phpmyadmin it is showing a warning showing below.

Is is clearly showing that error/warning in

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

Here phpmyadmin library try to counting some parameter but got wrong a code according to latest php version.
So we need to update sql.lib.php file by using any tool or ssh tools. I am using Putty for that.

Open sql.lib.php using following command.

$ sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

Now Press CTRL + W for search keyword and search for (count($analyzed_sql_results['select_expr'] == 1)

Replace it with following expression. ((count($analyzed_sql_results['select_expr']) == 1)


Save file and exit. (Press CTRL + X , CTRL + X, press Y and then press ENTER)

There may be another issue about Import/Export issues

May be you are also getting an error/Warning after solving above problem in ./libraries/plugin_interface.lib.php#551 under import and export tabs:

Edit plugin_interface.lib.php using following command.

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

Now same again press CTRL + W and search for count($options) > 0

Replace with if ($options != null) {


Save file and exit. (Press CTRL + X, press Y and then press ENTER).

Happy Coding 😃

Last modified: March 12, 2019