TECHIES WORLD

For Techs.... Techniques.... Technologies....

ApacheBashCpanelLinuxMysqlPHP

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

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

This error occurs on using PhpMyAdmin with latest versions of PHP due to some incompatibilities.

We can resolve this problem by modifying the file "/usr/share/phpmyadmin/libraries/sql.lib.php".

The following lines in this file,

((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr'] == 1)
    && ($analyzed_sql_results['select_expr'][0] == '*')))

Should replace with,

((empty($analyzed_sql_results['select_expr']))
|| (count($analyzed_sql_results['select_expr']) == 1)
    && ($analyzed_sql_results['select_expr'][0] == '*'))

Apache service need to be restarted after saving the changes to this file.

That's all…

Leave a Reply