phpMyAdmin not working after upgrade from Ubuntu 16.04 to 18.04

Hubert Schölnast asked:

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/ 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/ 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/ failed to open stream: Operation not permitted in /usr/share/phpmyadmin/libraries/ 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/' (include_path='.') in /usr/share/phpmyadmin/libraries/ 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/ 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 file. Useful when you want php-gettext somewhere else,
 * eg. /usr/share/php/gettext/
if (is_dir('/usr/share/php/php-php-gettext/')) {
    define('GETTEXT_INC', '/usr/share/php/php-php-gettext/');
} else {
    define('GETTEXT_INC', '/usr/share/php/php-gettext/');

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.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, line 74 to 77:

 * Load gettext functions.
require_once GETTEXT_INC;

What is wrong here?

more important: What must I do to correct it?

My answer:

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.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.