Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

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

    RahulBy RahulJanuary 25, 20211 Min ReadUpdated: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.

    phpmyadmin
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to View or List Cron Jobs in Linux
    Next Article How to Set Up SSH Tunnel with PuTTY

    Related Posts

    How to Install Sublime Text 4 on Ubuntu 22.04

    2 Mins Read

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    How To Install Oracle VirtualBox on Debian 11

    2 Mins Read

    5 Comments

    1. Thomas Anderson on October 11, 2021 6:00 pm

      Excellent! Worked like a charm!

      Reply
      • Thomas Anderson on October 11, 2021 6:03 pm

        Version applied to: Version information: 4.7.0
        Thank you for the solution!

        Reply
    2. sysdev on October 4, 2021 12:39 pm

      this work for me also, thanks.

      Reply
    3. René on August 27, 2021 1:10 pm

      Worked, thank you!

      Reply
    4. Jason on August 18, 2021 12:08 pm

      This worked for me! Thanks!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.