phpmyadmin-count():パラメータはCountableを実装する配列またはオブジェクトでなければなりません

6932 ワード

phpmyadmin-count():Parameter must be an array or an object that implements Countable
I've uploaded the backup to a table,opening the table I see this:バックアップをテーブルにアップロードし、テーブルを開きました.
Warning in ./libraries/sql.lib.php#601
count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/sql.lib.php#2038: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#1984: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'alternativegirls',
string 'tgp_photo',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `tgp_photo`',
NULL,
NULL,
)
./sql.php#216: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'alternativegirls',
string 'tgp_photo',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `tgp_photo`',
NULL,
NULL,
)
./index.php#53: include(./sql.php)

Inside phpMyAdmin... phpMyAdminの内部で...
PHP is 7.2, the server is Ubuntu 16.04, installed yesterday. PHPは7.2で、サーバーはUbuntu 16.04で、昨日インストールしました.
Looking for I saw that some have this error in their code, but I did not find anyone who received it in phpMyAdmin... 彼らのコードにこのエラーがある人がいることに気づきましたが、phpMyAdminでこのエラーを受け取った人は見つかりませんでした.
What should I do? どうすればいいの?Is that my error? それは私の間違いですか.A phpmyadmin error? phpmyadminエラー?wait update ? 更新待ち?I go back to PHP 7.1? PHP 7.1に戻りますか?

1階


参照先:https://stackoom.com/question/3FPOr/phpmyadmin-count-パラメータは、Countableを実装する配列またはオブジェクトである必要があります.

2階


phpmyadmin 4.7.4 is supposed to have"Fixed several compatibility issues with PHP 7.2"phpmyadmin 4.7.4はすでに"PHP 7.2のいくつかの互換性の問題を解決したはずだ"
Chances are you have an older version of phpmyadmin. 古いphpmyadminバージョンがあるかもしれません.
https://www.phpmyadmin.net/news/2017/8/24/phpmyadmin-474-released/https://www.phpmyadmin.net/news/2017/8/24/phpmyadmin-474-released/

#3階


tested on Debian,should works on Ubuntu:Debianでテストしました.Ubuntuで実行できるはずです.
1.) First download latest phpMyadmin file. 1.)まず最新のphpMyadminファイルをダウンロードします.
2.) Delete (make a backup) all previous version file located in /usr/share/phpmyadmin directory. 2.)/usr/share/phpmyadminディレクトリのすべての以前のバージョンのファイルを削除(バックアップ)します.
3.) Uncompress to /usr/share/phpmyadmin/ directory all files of latest phpmyadmin. 3.)最新phpmyadminのすべてのファイルを/usr/share/phpmyadmin/ディレクトリに解凍します.
4.) Modify file libraries/vendor_config.php and change line: 4.)ファイルlibraries/vendor_config.phpを変更し、行を変更します.
define('CONFIG_DIR', '');

to至
define('CONFIG_DIR', '/etc/phpmyadmin/');

and和
define('TEMP_DIR', './tmp/');

to至
define('TEMP_DIR', '/tmp/');

5.) restart apache server and done. 5)apacheサーバを再起動して完了します.

#4階


I found this PHP 7.2 count() - SYNTAX error in sql.lib.php私はsqlにいます.lib.phpでこのPHP 7.2 count()-SYNTAXエラーが見つかりました
That perfectly works on my config:これは私の構成で完全に機能します.
Debian 9, 
PHP 7.2.3-1+0~20180306120016.19+stretch~1.gbp81bf3b (cli) (built: Mar  6 2018 12:00:19) ( NTS )

Open /usr/share/phpmyadmin/libraries/sql.lib.phpオープン/usr/share/phpmyadmin/libraries/sql.lib.phpChange line:Move parenthesis before==改行:カッコを==の前に移動
|| || ( (count($analyzed_sql_results['select_expr'] ) == 1) && ($analyzed_sql_results['select_expr'][0] == '*'))) ( (count($ analyzed_sql_results ['select_expr'] ) == 1)&&($ analyzed_sql_results ['select_expr'] [0] =='*')))
inは
function PMA_isRememberSortingOrder($analyzed_sql_results){

return $GLOBALS['cfg']['RememberSorting']
    && ! ($analyzed_sql_results['is_count']
        || $analyzed_sql_results['is_export']
        || $analyzed_sql_results['is_func']
        || $analyzed_sql_results['is_analyse'])
    && $analyzed_sql_results['select_from']
    && ((empty($analyzed_sql_results['select_expr']))
        || ((count($analyzed_sql_results['select_expr'] ) == 1)
            && ($analyzed_sql_results['select_expr'][0] == '*')))
    && count($analyzed_sql_results['select_tables']) == 1;
 }

#5階


Edit file /usr/share/phpmyadmin/libraries/sql.lib.php:編集ファイル/usr/share/phpmyadmin/libraries/sql.lib.php:
sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

On line 613 the count function always evaluates to true since there is no closing parenthesis after $analyzed_sql_results['select_expr'] . 613行目では、$analyzed_sql_results['select_expr']以降に右かっこがないため、count関数は常にtrueとして評価される.Making the below replacements resolves this, then you will need to delete the last closing parenthesis on line 614, as it's now an extra parenthesis. この問題を解決するには、614行目の最後の右かっこを削除する必要があります.これは、余分なカッコになっているためです.
Replace:交換:
((empty($analyzed_sql_results['select_expr']))
    || (count($analyzed_sql_results['select_expr'] == 1)
        && ($analyzed_sql_results['select_expr'][0] == '*')))

With:
((empty($analyzed_sql_results['select_expr']))
    || (count($analyzed_sql_results['select_expr']) == 1)
        && ($analyzed_sql_results['select_expr'][0] == '*'))

Restart the server apache:サーバapacheの再起動:
sudo service apache2 restart

#6階


Try replace this function in file:/usr/share/phpmyadmin/libraries/sql.lib.phpは、/usr/share/phpmyadmin/libraries/sqlと次のファイルに置き換えてみます.lib.php
function PMA_isRememberSortingOrder($analyzed_sql_results)
{
    return $GLOBALS['cfg']['RememberSorting']
        && ! ($analyzed_sql_results['is_count']
            || $analyzed_sql_results['is_export']
            || $analyzed_sql_results['is_func']
            || $analyzed_sql_results['is_analyse'])
        && $analyzed_sql_results['select_from']
        && ((empty($analyzed_sql_results['select_expr']))
            || (count($analyzed_sql_results['select_expr']) == 1)
                && ($analyzed_sql_results['select_expr'][0] == '*'))
        && count($analyzed_sql_results['select_tables']) == 1;
}