phpmyadmin – upierdliwy błąd Parameter must be an array or an object that implements Countable [Aktualizacja]

Objawia się to wywaleniem (przy praktycznie każdej operacji SELECT) dużego ostrzeżenia o błędzie, który trzeba za każdym razem igonorować:

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

Backtrace

./libraries/sql.lib.php#2128: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#2079: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'consiloldmodx',
string 'modx_site_templates',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `modx_site_templates`',
NULL,
NULL,
)
./sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'consiloldmodx',
string 'modx_site_templates',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `modx_site_templates`',
NULL,
NULL,
)

Aby to naprawić należy przeedytować plik:

sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

Znaleźć (CTRL + W) fragment kodu:

count($analyzed_sql_results['select_expr'] == 1)

Następnie zamienić go na:

(count($analyzed_sql_results['select_expr']) == 1)

Po restarcie Apache’a:

sudo service apache2 restart

Problem powinien się już nie pojawiać.

UWAGA!

Problem może pojawiać się także w przypadku pliku:

sudo nano /usr/share/phpmyadmin/libraries/plugin_interface.lib.php

Wtedy analogicznie zamień wystąpienie w nim:

if ($options != null && count($options) > 0) {

na:

if ($options != null && @count($options) > 0) {

i zrestartuj Apache’a

 

Możesz również polubić…

Inna porada:
Dziś co nieco o użytecznej komendzie touch i co można…