phpmyadmin处理请求时出错错误代码:500错误文本:内部服务器错误

im9ewurl  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(617)

当我运行phpmyadmin并单击以导出/导入时,总是出现一个错误:
处理请求时出错错误代码:500错误文本:内部服务器错误。操作系统-ubuntu 18.04

tsm1rwdh

tsm1rwdh1#

编辑文件/usr/share/phpmyadmin/libraries/sql.lib.php:

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

替换:

function PMA_isRememberSortingOrder($analyzed_sql_results)
{
    ......
}

使用:

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);
}

重新启动服务器:

sudo service apache2 restart

这应该管用。

2eafrhcq

2eafrhcq2#

我面临着这个问题。我的php版本是7.2。实际上,这个错误来自phpmyadmin库。库名称是/usr/share/phpmyadmin/libraries/sql.lib.php。在这个文件第614行。所以你需要修改文件
从(&&($analysed\u sql\u results['select\u expr'][0]==''))
到&($analysed\u sql\u results['select\u expr'][0]=='
'))
或者您可以替换以下完整方法:

/**

* Function to check whether to remember the sorting order or not
* 
* @param array $analyzed_sql_results the analyzed query and other variables set
* after analyzing the query
* 
* @return boolean
* /

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;
}

我希望这能有所帮助。谢谢您。

相关问题