Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpMyAdmin Error in processing request Error code: 500 Error text: Internal Server Error [duplicate]

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

like image 544
Ovruchsky Avatar asked Jul 30 '18 05:07

Ovruchsky


People also ask

How do you fix 500 Internal server error There is a problem with the resource you are looking for and it Cannot be displayed?

There is a problem with the resource you are looking for, and it cannot be displayed. The first solution to a 500 internal server error is to refresh the page. If the error persists, you may try clearing the cookies, deactivating faulty plugins or themes, fixing the . htaccess file, or contacting your hosting provider.

How do I fix request failed with status code 500?

Most of the time, the issue is only temporarily and can be corrected by trying the page again. You can use the refresh/reload button, pressing F5 , or by trying the URL again from the address bar. Sometimes this error is caused when a service restarts, and you happen to catch it at exactly the wrong time.


2 Answers

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.

like image 141
Kalyan Halder Raaz Avatar answered Oct 16 '22 20:10

Kalyan Halder Raaz


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.

like image 3
Ratul Hasan Avatar answered Oct 16 '22 22:10

Ratul Hasan