当我运行phpMyAdmin并单击“导出/导入”时,总是出现错误:
处理请求时出错错误代码:500错误文本:Internal Server Error。 操作系统-Ubuntu 18.04
答案 0 :(得分:7)
我遇到了问题。我的php版本是 7.2 。实际上,此错误来自phpmyadmin库。库名称为 /usr/share/phpmyadmin/libraries/sql.lib.php 。在此文件行中,没有 614 。因此,您需要修改文件
来自 &&($ analyzed_sql_results ['select_expr'] [0] =='*')))
至和&($ analyzed_sql_results ['select_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;
}
我希望这会有所帮助。谢谢。
答案 1 :(得分:1)
编辑文件/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);
}
重新启动服务器apache:
sudo service apache2 restart
这应该有效。