10

When i'm running phpMyAdmin and click to Export/Import I always get an error:

Error in processing request Error code: 500 Error text: Internal Server Error. OS - Ubuntu 18.04

Ovruchsky
  • 105
  • 1
  • 1
  • 6
  • 2
    To see the _actual_ error message, check your servers error log. You can also change how PHP displays errors and tell it to show all errors directly on the screen (this is not something you want in production though, since it can show sensitive data, but during development, you should). Here's how to show all errors and warnings: https://stackoverflow.com/questions/5438060/showing-all-errors-and-warnings – M. Eriksson Jul 30 '18 at 05:19

2 Answers2

25

I faced problem. My php version was 7.2. Actually this error comes from a phpmyadmin library. The library name is /usr/share/phpmyadmin/libraries/sql.lib.php. In this file line no 614. So you need to modify the file

From && ($analyzed_sql_results['select_expr'][0] == '*')))

to && ($analyzed_sql_results['select_expr'][0] == '*'))

or you can replace full method bellow:

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

I hope this may help. Thank you.

Kalyan Halder
  • 1,485
  • 24
  • 28
  • thanks that worked for me. when this was functioning ok before. not sure what is up with phpmyadmin these days loads of bugs. – K-G May 14 '19 at 11:39
  • I have installed phpmyadmin into `/home/mydomain/phpmyadmin` path but i can't find `sql.lib.php` file, could you tell me how to find it? thank you – Fernando Torres Sep 03 '19 at 16:35
  • Find the folder *libraries* inside in phpmyadmin. then try to find sql.lib.php. its like phpmyadmin/libraries/sql.lib.php – Kalyan Halder Sep 04 '19 at 07:16
3

Edit file /usr/share/phpmyadmin/libraries/sql.lib.php:

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

Replace:

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

With:

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

Restart the server apache:

sudo service apache2 restart

This should work.