Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at: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”

    By RahulJanuary 25, 20211 Min Read

    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.

    Advertisement
    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

    Related Posts

    How to Split Large Archives in Linux using the Command Line

    System.out.println() Method in Java: A Beginner’s Guide

    sleep Command in Linux with Examples

    View 7 Comments

    7 Comments

    1. Michael on November 13, 2022 9:59 pm

      It works! Thank you!

      Reply
    2. Tikyda on June 15, 2022 2:17 am

      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.

      Reply
    3. 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
    4. sysdev on October 4, 2021 12:39 pm

      this work for me also, thanks.

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

      Worked, thank you!

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

      This worked for me! Thanks!

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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