0

Getting the below error access http://45.76.144.192:8080/index.php

[error] 6016#0: *30 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function __() in /usr/share/phpMyAdmin/libraries/core.lib.php:245
Stack trace:
#0 /usr/share/phpMyAdmin/libraries/session.inc.php(100): PMA_fatalError('Error during se...')
#1 /usr/share/phpMyAdmin/libraries/common.inc.php(350): require('/usr/share/phpM...')
#2 /usr/share/phpMyAdmin/index.php(12): require_once('/usr/share/phpM...')
#3 {main}
  thrown in /usr/share/phpMyAdmin/libraries/core.lib.php on line 245" while reading response header from upstream, client: 45.248.66.156, server: _, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "45.76.144.192:8080"

Below is what i tried but still it does not work.

1.

chmod 644 /usr/share/phpMyAdmin/setup/frames/config.inc.php
chmod 644 /usr/share/phpMyAdmin/test/test_data/config.inc.php
chmod -R 775 /var/opt/remi/php72/lib/php/session

2.

sudo  yum remove  phpmyadmin
sudo  yum autoremove  phpmyadmin
sudo yum install phpmyadmin

Below is the php details:

php72 -v
PHP 7.2.15 (cli) (built: Feb  5 2019 18:05:51) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.15, Copyright (c) 1999-2018, by Zend Technologies

# php72 -m


[PHP Modules]
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    exif
    fileinfo
    filter
    ftp
    gd
    gettext
    hash
    iconv
    json
    libxml
    mbstring
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    readline
    Reflection
    session
    SimpleXML
    sockets
    SPL
    sqlite3
    standard
    tokenizer
    wddx
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zlib

    [Zend Modules]
    Zend OPcache

uname -a
Linux myhost 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I am running everything with root user so permissions should not be an issue i guess.

James Z
  • 12,209
  • 10
  • 24
  • 44
Ashar
  • 2,942
  • 10
  • 58
  • 122

2 Answers2

0

Following Call to undefined function __() error - phpMyAdmin

Depending on your OS did you try:

(CentOS)

sudo yum install php-mbstring

(Debian)

sudo apt-get install php7.0-mbstring

And then restart your apache process.

Check the phpMyAdmin requirements

  • You need PHP 7.1.0 or newer, with session support, the Standard PHP Library (SPL) extension, hash, ctype, and JSON support.
  • The mbstring extension (see mbstring) is strongly recommended for performance reasons.
  • To support uploading of ZIP files, you need the PHP zip extension.
  • You need GD2 support in PHP to display inline thumbnails of JPEGs (“image/jpeg: inline”) with their original aspect ratio.
  • When using the cookie authentication (the default), the openssl extension is strongly suggested.
  • To support upload progress bars, see 2.9 Seeing an upload progress bar.
  • To support XML and Open Document Spreadsheet importing, you need the libxml extension.
  • To support reCAPTCHA on the login page, you need the openssl extension.
  • To support displaying phpMyAdmin’s latest version, you need to enable allow_url_open in your php.ini or to have the curl extension.
ALFA
  • 1,726
  • 1
  • 10
  • 19
  • Already did this: sudo yum install php-mbstring Output: Package php-mbstring-7.2.15-1.el7.remi.x86_64 already installed and latest version – Ashar Mar 03 '19 at 11:17
  • Looks like everything is update:# sudo yum update Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.0x.sg * epel: sg.fedora.ipserverone.com * extras: mirror.0x.sg * remi-php72: ftp.riken.jp * remi-safe: ftp.riken.jp * updates: mirror.0x.sg No packages marked for update – Ashar Mar 03 '19 at 11:25
  • Seems like a permission problem. Can you check what's the owner of the phpmyadmin folder? `ls -l` – ALFA Mar 03 '19 at 11:30
  • is this concerning ? ls -ltrd /usr/share/phpMyAdmin drwxr-xr-x 10 root root 4096 Mar 2 22:18 /usr/share/phpMyAdmin – Ashar Mar 03 '19 at 11:52
  • should I do this anyways ? chmod -R 775 /usr/share/phpMyAdmin – Ashar Mar 03 '19 at 11:54
  • You tried to set `chmod -R 775` on your session folder which means you set read/write/execute on owner and group, and read/execute on others. Try set 777 to test out if the apache user would get write permission on session folder. Note: This is just to test if it's a permission problem. – ALFA Mar 03 '19 at 11:55
  • Note: restart apache upon changing something. – ALFA Mar 03 '19 at 12:03
  • There is no apache user . I have mentioned that i do everything using root user. I do restart apache everytime: service nginx stop Redirecting to /bin/systemctl stop nginx.service [root@vultr ~]# service nginx start Redirecting to /bin/systemctl start nginx.service – Ashar Mar 03 '19 at 12:14
  • My bad sorry. Perhaps you should try to give permissions to /usr/share/phpMyAdmin as you mentioned above. I read someone solved this way. – ALFA Mar 03 '19 at 12:28
  • I changed the permissions: chmod -R 775 /usr/share/phpMyAdmin but the issue remains. # ls -ltrd /usr/share/phpMyAdmin drwxrwxr-x 10 root root 4096 Mar 2 22:18 /usr/share/phpMyAdmin – Ashar Mar 03 '19 at 12:58
  • So browsing a bit I found this [article](https://caradede.blogspot.com/2017/12/how-to-solve-phpmyadmin-sessionstart.html), read it carefully as it starts with a very similar problem (Probably the same). I don't know if it could be useful but it's a step forward to try every solutions. – ALFA Mar 03 '19 at 13:05
  • The article helped !! [root@amazon]# chgrp nginx -R /var/lib/php/session helped resolve the problem. Thanks – Ashar Mar 03 '19 at 20:51
0

This command helped resolve my issue.

[root@amazon]# chgrp nginx -R /var/lib/php/session
Ashar
  • 2,942
  • 10
  • 58
  • 122
  • 1
    Don't do this, the permission will be restored on next update. Create another directory for this user, as explained in the pool configuration file (www.conf) – Remi Collet Mar 04 '19 at 06:04