This error is caused by a line of code in /usr/share/phpmyadmin/libraries/sql.lib.php
.
It seems when I installed phpMyAdmin using apt
, the version in the repository (phpMyAdmin v4.6.6) is not fully compatible with PHP 7.2. There is a newer version available on the official website (v4.8 as of writing), which fixes these compatibility issues with PHP 7.2.
You can download the latest version and install it manually or wait for the repositories to update with the newer version.
Alternatively, you can make a small change to sql.lib.php
to fix the error.
Firstly, backup sql.lib.php
before editing.
sudo cp /usr/share/phpmyadmin/libraries/sql.lib.php /usr/share/phpmyadmin/libraries/sql.lib.php.bak
Edit sql.lib.php
using vi
:
sudo vi /usr/share/phpmyadmin/libraries/sql.lib.php
Using nano
:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php
Press CTRL + W (for nano) or ?
(for vi/vim) and search for:
(count($analyzed_sql_results['select_expr'] == 1)
Replace it with:
((count($analyzed_sql_results['select_expr']) == 1)
Save file and exit. (Press CTRL + X, press Y and then press ENTER for nano
users / hit ESC then type :wq
and press ENTER)