我已经上传了备份到一个表,打开表我看到这个:

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)

在phpMyAdmin……

PHP是7.2,服务器是Ubuntu 16.04,昨天安装的。

我看到一些人在他们的代码中有这个错误,但我没有发现任何人在phpMyAdmin中收到它…

我该怎么办?这是我的错误吗?phpmyadmin错误?等待更新?回到PHP 7.1?


当前回答

我尝试了以上所有的解决方案,但都不适合我。

试试这个:

安装所需的PHP版本(在我的例子中是7.0),然后在终端中键入

sudo update-alternatives --config php

输出如下所示:-

然后,只需输入选择号(在我的例子中是1),就可以切换到任何版本的PHP。

希望这可以帮助其他-:)

其他回答

我看到你们都在编辑或更新我们的文件

对于那些想要自动更新的人,你可以使用我们的Ubuntu PPA

Sudo add-apt-repository ppa:phpmyadmin/ppa

对于Debian用户,您需要等待Debian的下一个版本或使用PPA

Ubuntu 20有phpMyAdmin 4.9或更高版本

我们的跟踪器上的Debian问题

我们跟踪器上的可数问题

TLDR 请更新到最新的4.9或5.0版本以解决此问题。

适用于UBUNTU 16.04.3 打开

usr / share /图书馆/ sql.lib.php

修改

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

To

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

Works on UBUNTU 18.04 


Edit file: '/usr/share/phpmyadmin/libraries/sql.lib.php'
Replace: (count($analyzed_sql_results['select_expr'] == 1)
With:  ((count($analyzed_sql_results['select_expr']) == 1)

Restart the server
sudo service apache2 restart

这些方法对我来说都没用 您需要将phpmyadmin更新到最新版本,请遵循此处的说明

https://askubuntu.com/questions/947805/how-to-upgrade-phpmyadmin-revisited

添加phpmyadmin ppa

sudo add-apt-repository ppa:phpmyadmin/ppa
sudo apt-get update
sudo apt-get upgrade