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?

  • https://secure.php.net/manual/de/ini.core.php#ini.open-basedir – Michael Hampton Aug 27 '18 at 19:01
  • @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! – Hubert Schölnast Aug 27 '18 at 19:11
  • Oops, this is an English language site. But I have posted an answer. – Michael Hampton Aug 27 '18 at 19:14
  • 1
    @MichaelHampton: You sent me a link to the German manual site of phpMyAdmin, so I thought you're speaking German. – Hubert Schölnast Aug 27 '18 at 19:15

1 Answers1

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.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • 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 '19 at 21:52
  • @AntoineF. This was the only thing that worked for me. – Dan Walters Jan 02 '20 at 08:54