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

1
  • 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: stackoverflow.com/questions/5438060/… Commented Jul 30, 2018 at 5:19

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

3 Comments

thanks that worked for me. when this was functioning ok before. not sure what is up with phpmyadmin these days loads of bugs.
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
Find the folder libraries inside in phpmyadmin. then try to find sql.lib.php. its like phpmyadmin/libraries/sql.lib.php
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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.