Mysql apache2 - phpmyadmin import error (php 7.2)



我刚刚在运行PHP 7.2和PhpMyAdmin的Apache2上安装了虚拟主机,现在我正在尝试从旧服务器导入数据库。当我在PhpMyAdmin上单击导入时,我收到此错误。

有人可以帮我解决这个问题吗?

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> ' 

嗨,以下内容绝对解决了我的相同问题(导入/导出等(:

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_interface.lib.php

找到以下行(ctrl+f(:

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

对我来说是在线#551

并更改以下内容:

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

Ctrl+s 用于保存更改

在终端中:Ctrl+C 用于取回程序...

以及:sudo systemctl restart apache2

"我认为在新的php版本中。它不能将 count(( 或 sizeof(( 与 un 数组类型一起使用。将参数强制到数组是解决此错误的简单方法,...">

感谢原作者解决问题!我试着分享它!

Open/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 中为我工作

最新更新