• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

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

Written by Rahul, Updated on January 25, 2021

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”

Warning in ./libraries/sql.lib.php#613 count()

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.

  1. Make a backup of sql.lib.php
    sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak 
    
  2. Next, edit sql.lib.php in your favorite text editor:
    sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php 
    
  3. 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)

    Fixed - Warning in ./libraries/sql.lib.php#613 count()

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

All done. The error message should disappear now.

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Debian 10
  • Download Ubuntu 20.04 LTS – DVD ISO Images
  • Linux Run Commands As Another User
  • How to Check PHP Version (Apache/Nginx/CLI)
  • How To Install and Configure GitLab on Ubuntu 20.04
  • How to Install PyCharm on Ubuntu 20.04
  • How to Check Ubuntu Version with Command or Script
  • How to Set all directories to 755 And all files to 644
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy