Internal server error (HTTP Error 500) after installing phpmyadmin on a certain domain

后端 未结 6 1206
感情败类
感情败类 2021-02-04 20:07

I\'m getting internal server error (HTTP Error 500) after installing phpmyadmin on a certain domain.

This is what my config.inc.php file currently reads

相关标签:
6条回答
  • 2021-02-04 20:27

    If you are using apache2.4 and PHP 7, run

    sudo apt-get install php-mbstring php7.0-mbstring php-gettext
    

    then restart your server

    sudo service apache2 restart
    
    0 讨论(0)
  • 2021-02-04 20:30

    Ensure that your PHP version matches the used PHP module in Apache2:

    php -v  //PHP 7.4.4 
    ls -d /etc/apache2/mods-enabled/php*.conf // php7.3.conf
    
    sudo a2dismod php7.3  // disable 7.3
    sudo a2enmod php7.4   // enable 7.4
    sudo systemctl restart apache2
    

    I installed the php-mbstring php-gettext (also excplicitly for latest PHP version), but it still wasn't working. At least it took me hours until I noticed apache decides itself what PHP version is used.

    0 讨论(0)
  • 2021-02-04 20:30

    After applying all the above mentioned solution, none worked for me.

    This worked for me:

    I thing this error comes from a phpmyadmin library

    So, we need to modify following File

    File Location : /usr/share/phpmyadmin/libraries/sql.lib.php

    Line No : 614

    run following command in ubuntu terminal

    sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php Replace two codes :

    Replace : (count($analyzed_sql_results[‘select_expr’] == 1)

    With : (count($analyzed_sql_results[‘select_expr’]) == 1)

    Replace : && ($analyzed_sql_results[‘select_expr’][0] == ‘*’)))

    With : && ($analyzed_sql_results[‘select_expr’][0] == ‘*’))

    0 讨论(0)
  • 2021-02-04 20:32

    OK, if you have already installed packages php-mbstring and php-gettext and it still doesn't work, first take a look to Apache logs:

    tail /var/log/apache2/error.log
    

    If you find something like this:

    Fatal error: Uncaught Twig_Error_Syntax: Unexpected "apply" tag (expecting closing tag for the "if" tag defined near line 17). in /usr/share/phpmyadmin/templates/columns_definitions/column_virtuality.twig on line 17

    This is a known bug in phpmyadmin 4.9.4

    The bug has been fixed in phpmyadmin 4.9.5 but please note that if you are under Debian 10 Buster you will need to upgrade the package php-twig to an higher version rather than the one included with Buster, or package phpmyadmin will be kept back to 4.9.4 during system upgrades.

    You can simply upgrade php-twig from next Debian version (11, Bullseye)

    apt-get install php-twig/bullseye
    

    This worked for me. Hope this doesn't broke something else in Deb 10 LAMP setup.

    0 讨论(0)
  • 2021-02-04 20:35

    I know it has been a couple of years, and I noticed by your comments that still no luck. Here I run into the same 500 error after installing through apt. I look for my Apache error log file (/var/log/apache2/error.log), and there was the following entry:

    [Thu Aug 11 22:38:25.930453 2016] [:error] [pid 18138] [client ::1:35026] PHP Fatal error:  require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.:/usr/share/php') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 477
    

    It shows that the library gettext was not found, so I intalled it:

    sudo apt-get install  php-gettext
    

    And restarted Apache:

    sudo service apache2 restart
    

    That worked for me. Hope it helps. PS: If still not working you may try to sym link the folder just in case:

    sudo ln -s /usr/share/phpmyadmin /var/www/
    
    0 讨论(0)
  • 2021-02-04 20:53

    if you want to access the mysql data from your server to your computer

    you need to change

    $cfg['Servers'][$i]['host'] = 'localhost';
    

    to you server ip address.

    $cfg['Servers'][$i]['host'] = 'your.server.ip.add.here';
    

    update

    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Servers'][$i]['host'] = 'your.server.ip.add.here';
    $cfg['Servers'][$i]['user'] = 'db name here';
    $cfg['Servers'][$i]['password'] = 'db password';
    

    make sure that those fields are properly set up..

    0 讨论(0)
提交回复
热议问题