1

I have an Ubuntu server with MySQL, Apache2 and phpMyAdmin. Today I made an upgrade from Ubuntu 16.04 to 18.04. Now I have the problem, that phpMyAdmin is showing just a blank white webpage without any content.

I found these entries in the apache error log (client and referer edited by me):

[Mon Aug 27 20:10:00.558433 2018] [php7:warn] [pid 17925] [client <ip:port>] PHP Warning:  is_dir(): open_basedir restriction in effect. File(/usr/share/php/php-php-gettext/) is not within the allowed path(s): (/usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/) in /usr/share/phpmyadmin/libraries/vendor_config.php on line 64, referer: <url>
[Mon Aug 27 20:10:00.560176 2018] [php7:warn] [pid 17925] [client <ip:port>] PHP Warning:  require_once(): open_basedir restriction in effect. File(/usr/share/php/php-php-gettext/gettext.inc) is not within the allowed path(s): (/usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/) in /usr/share/phpmyadmin/libraries/common.inc.php on line 77, referer: <url>
[Mon Aug 27 20:10:00.561106 2018] [php7:warn] [pid 17925] [client <ip:port>] PHP Warning:  require_once(/usr/share/php/php-php-gettext/gettext.inc): failed to open stream: Operation not permitted in /usr/share/phpmyadmin/libraries/common.inc.php on line 77, referer: <url>
[Mon Aug 27 20:10:00.561554 2018] [php7:error] [pid 17925] [client <ip:port>] PHP 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 77, referer: <url>

These log lines refer to these resources:

  • /usr/share/phpmyadmin/libraries/vendor_config.php on line 64
  • /usr/share/phpmyadmin/libraries/common.inc.php on line 77

But these are files I never did change manually. So I do not dare to change them now.

This is vendor_config.php, line 60 to 68 (line 64 begins with "if"):

/**
 * Path to gettext.inc file. Useful when you want php-gettext somewhere else,
 * eg. /usr/share/php/gettext/gettext.inc.
 */
if (is_dir('/usr/share/php/php-php-gettext/')) {
    define('GETTEXT_INC', '/usr/share/php/php-php-gettext/gettext.inc');
} else {
    define('GETTEXT_INC', '/usr/share/php/php-gettext/gettext.inc');
}

Both directories,

  • /usr/share/php/php-gettext/
  • /usr/share/php/php-php-gettext/

do exist. Their owner is root:root, permission is for both: 755

php-gettext contains 3 symlinks to the 3 files in php-php-gettext (link and target with the same name), which are:

  • gettext.inc
  • gettext.php
  • streams.php

All files belong to root:root. Permissions of symlinks: 777. Permissions of the files in php-php-gettext is: 644.


This is common.inc.php, line 74 to 77:

/**
 * Load gettext functions.
 */
require_once GETTEXT_INC;

What is wrong here?

more important: What must I do to correct it?

4
  • @MichaelHampton: Danke! Ich habe in der Apache-Konfiguration die Zeile, die mit php_admin_value open_basedir beginnt, hinter /usr/share/php/php-gettext/ eingefügt: :/usr/share/php/php-php-gettext/. Damit hat es geklappt. Kannst du bitte noch eine kurze Antwort schreiben, damit ich sie upvoten und akzeptieren kann? - Nochmal Danke! Aug 27, 2018 at 19:11
  • Oops, this is an English language site. But I have posted an answer. Aug 27, 2018 at 19:14
  • 1
    @MichaelHampton: You sent me a link to the German manual site of phpMyAdmin, so I thought you're speaking German. Aug 27, 2018 at 19:15

1 Answer 1

2

It looks like the location of your PHP gettext directory changed with the upgrade, and you are using open_basedir to restrict which directories PHP files are loaded from.

To resolve the problem, update your open_basedir setting in php.ini (or possibly in Apache's configuration) to contain the new path.

2
  • In my case it was /etc/apache2/conf-enabled/phpmyadmin.conf, i added :/usr/share/php/php-php-gettext/ at the end of php_admin_value open_basedir line. Followed by a service apache2 restart.
    – Antoine F.
    Sep 20, 2019 at 21:52
  • @AntoineF. This was the only thing that worked for me. Jan 2, 2020 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .