我刚刚在apache2上安装了运行PHP7.2和phpmyadmin的虚拟主机,现在我正在尝试从旧服务器导入数据库。当我在phpmyadmin上单击import时,我得到了这个错误。
有人能帮我解决这个问题吗。
Warning in ./libraries/plugin_interface.lib.php#551
count (): Parameter must be an array or an object that implements Countable
Backtrace
./libraries/display_export.lib.php#381: PMA_pluginGetOptions (
string 'Export',
array,
)
./libraries/display_export.lib.php#883: PMA_getHtmlForExportOptionsFormat (array)
./libraries/display_export.lib.php#1099: PMA_getHtmlForExportOptions (
string 'server',
string '',
string '',
string '<div> <a href="#" onclick="setSelectOptions(\'dump\', \' db_select[]\', true); return false;"> Select All </a> / <a href = "#" onclick = "setSelectOptions (\ 'dump \', \ 'db_select [] \', false); return false;"> Unfair all </a> <br /> <select name = "db_select []" id = "db_select" size = "10" multiple = "multiple"> <option value = "phpmyadmin" selected = "selected"> phpmyadmin </ option> </ select> </ div> ",
integer 0,
array
integer 0 ,
)
./server_export.php#47: PMA_getExportDisplay (
string 'server',
string '',
string '',
string '',
integer 0,
integer 0,
string '<div> <a href="#" onclick="setSelectOptions(\'dump\', \' db_select[]\', true); return false;"> Select All </a> / <a href = "#" onclick = "setSelectOptions (\ 'dump \', \ 'db_select [] \', false); return false;"> Unfair all </a> <br /> <select name = "db_select []" id = "db_select" size = "10" multiple = "multiple"> <option value = "phpmyadmin" selected = "selected"> phpmyadmin </ option> </ select> </ div> '
2条答案
按热度按时间ykejflvf1#
打开
/usr/share/phpmyadmin/libraries/plugin_interface.lib.php
(例如:sudo subl /usr/share/phpmyadmin/libraries/plugin_interface.lib.php
)转到551行,
替换
if ($options != null && count($options) > 0) {
与if ($options != null && (is_array($options) || $options instanceof Countable) && count($options) > 0) {
在ubuntu 18.04中为我工作8ulbf1ek2#
您好,下面的问题绝对可以解决我的问题(进口/出口等):
https://medium.com/@chaloemphonthipkasorn/%e0%b9%81%e0%b8%81%e0%b9%89-bug-phpmyadmin-php7-2-ubuntu-16-04-92b287090b01
所以。。。在ubuntu 18.04、mysql、php7.2下:终端:
sudo gedit/usr/share/phpmyadmin/libraries/plugin\u interface.lib.php
找到以下行(ctrl+f):
如果($options!=null&&count($options)>0){
我的电话在551线上
并更改为:
如果($options!=null&&count((数组)$选项)>0){
ctrl+s保存更改
在终端中:ctrl+c代表get back promt。。。
和:sudo systemctl restart apache2
“我认为在新的php版本中,不能将count()或sizeof()与un数组类型一起使用。将参数强制到数组是解决此错误的简单方法,“…”
感谢原作者解决问题!我试着分享它!