Call to undefined function __() error - phpMyAdmin

后端 未结 10 1434
温柔的废话
温柔的废话 2020-11-27 18:23

When i want run phpMyAdmin on my browser, that show me this error:

Fatal error: Call to undefined function __() in /usr/share/phpMyAdmin/libraries/core.lib.p         


        
相关标签:
10条回答
  • 2020-11-27 18:46

    If you are using a different user for a reason, e.g. when having httpd-itk (RHEL/CentOS/Fedora) or apache2-mpm-itk (Debian/Ubuntu) and your main user is not apache or www-data, then do:

    sudo usermod -a -G apache youruser
    

    or

    sudo usermod -a -G www-data youruser
    

    depending on your distribution, then phpMyAdmin will work.

    0 讨论(0)
  • 2020-11-27 18:47

    I encountered this after a parse error in config.inc.php. Unfortunately, phpMyAdmin sets error_reporting(0) while reading the configuration file. Open libraries/Config.class.php, search for $old_error_reporting = error_reporting(0); and replace it with $old_error_reporting = error_reporting(E_ALL); to see what's going on. Of course you should revert this change later for security reasons.

    0 讨论(0)
  • 2020-11-27 18:50

    Pretty much as other users had said... I'm running Debian 8 with PHP7 and ran into the issue, so just installing;

    sudo apt-get install php7.0-mbstring
    

    Followed by restarting the Apache service;

    sudo service apache2 restart
    

    And then phpmyadmin ran fine.

    0 讨论(0)
  • 2020-11-27 18:53

    For Debian users: (I ended up in this thread as a Debian user) I read @naveen 's answer and it appeared I didn't have php-mbstring installed, installing it solved my problem:

    sudo apt-get install php-mbstring
    

    (After installing php-mbstring, don't forget to restart Apache:)

    sudo systemctl restart apache2
    
    0 讨论(0)
  • 2020-11-27 18:58

    For me the error was in /usr/share/phpMyAdmin/libraries/sanitizing.lib.php.

    I increased php error reporting following this advice and commented the offending line in sanitizing.lib.php by prepending // in front.

    Then the error was more descriptive: Fatal error: require_once(): Failed opening required '/usr/share/php/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/common.inc.php on line 477

    I noticed that I somehow lost the php-gettext debian package, but after installing it phpMyAdmin worked again.

    0 讨论(0)
  • 2020-11-27 19:05

    Check that your session directory is writable by the webserver process.

    The best way to do so is to create your own phpinfo file; in any web accessible folder create a file (you can call it test.php or phpinfo.php or whatever you'd like) with the following content:

    <?php
    phpinfo();
    ?>
    

    Open that file in your browser (http://localhost/test.php or similar) and look for the line session.save_path. That's your session folder; make sure the permissions are suitable and see if that helps.

    More information from a similar thread.

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