15

After the upgrade of my ubuntu server to 13.04 my phpmyadmin is no longer reachable. the browser reports 500 (internal server error) and in the error.log it says:

PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.') in /usr/share/phpmyadmin/libraries/select_lang.lib.php on line 370

Any other php software works fine on the machine and so does mysql itself. Phpmyadmin is installed correctly and worked fine before the dist-upgrade. i also did sudo aptitude reinstall phpmyadmin but that did not help.

the version number of phpmyadmin is 4:3.5.8.1-1

any ideas, what could be wrong here?

/edit: by now i found out, that the symlinks here do not seem to work:

mcnesium@fluse:/usr/share/phpmyadmin/libraries/php-gettext$ ls -l
total 0
lrwxrwxrwx 1 root root 36 Apr 25 03:38 gettext.inc -> ../../../php/php-gettext/gettext.inc
lrwxrwxrwx 1 root root 36 Apr 25 03:38 gettext.php -> ../../../php/php-gettext/gettext.php
lrwxrwxrwx 1 root root 36 Apr 25 03:38 streams.php -> ../../../php/php-gettext/streams.php

i backed up the folder php-gettext and cp -r'd the symlinked one over, now it works. so this actually seems to be a symlink-problem.

this is the beginning of my /etc/phpmyadmin/apache.conf

# phpMyAdmin default Apache configuration
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

so it is supposed to follow symlinks right away. before the ubuntu upgrade everything worked fine. so whats the matter with the symlinks?

  • Check the permissions under /usr/share/php/php-gettext. Are you using SELinux/AppArmor? – dawud May 1 '13 at 19:34
7

For me the following solution solved the problem:

In my website conf file, I have the following section:

<IfModule mod_php5.c>
    AddType application/x-httpd-php .php

    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_flag register_globals Off
    php_admin_flag allow_url_fopen Off
    php_value include_path .
    php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
    php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/
</IfModule>

The only change I've made since Ubuntu 13.04 install is include /usr/share/php/php-gettext/ in the open_basedir, and that did the trick.

23

For others:

sudo apt-get install php-gettext

might be the answer (especially with php7 as it seems that this is not included by default, maybe because it is a pear extension).

  • I got the error after performing a fresh install of Ubuntu 16.04. It worked after upgrading 15.10 to 16.04, but I had to do a fresh install due to other problems. Explicitly installing the php-gettext package (and adding Require all granted to phpmyadmin.conf) made it work again. – bovender Apr 23 '16 at 11:55
  • 1
    this is the actual answer! – tika May 2 '16 at 3:02
  • Thanks for that; I didn't think of that; this and php-mbstring were required to get phpmyadmin to work right for me with php7 – jhaagsma May 2 '16 at 21:36
  • 1
    It's odd, because php-gettext is a dependency of the phpmyadmin package: packages.ubuntu.com/xenial/phpmyadmin so I'm not sure why it's not already there. – Sam Wilson Jul 7 '16 at 5:36
  • Install LAMP first, then phpmyadmin, maybe that is part of the problem – twicejr Jul 7 '16 at 11:31
5

If your open_basedir contains /usr/share/php/php-gettext/ already (as in my case) and you can't get it to work with the previous answers then do:

sudo rm /usr/share/phpmyadmin/libraries/php-gettext/*

removes the symbolic links

sudo ln /usr/share/php/php-gettext/* /usr/share/phpmyadmin/libraries/php-gettext

creates hard links

This makes phpmyadmin work again. Why it broke in 13.04 and the symbolic links aren't followed while the apache.conf says they should, remains a mystery to me.

  • Thanks, that did it. The open_basedir line already contained the php-gettext directory so reinstalling those links was necessary. – Karma Fusebox Feb 8 '14 at 2:08
0

I had to disable (prefix with #) the Alias /phpmyadmin /usr/share/phpmyadmin in /etc/apache2/conf-available/phpmyadmin.conf since I'm using a custom vhost file for phpmyadmin to serve it on a subdomain. With the additional Alias it didn't work for some reason.

0

If phpMyAdmin runs on an Nginx server, the php.ini additionally needs to add the path /usr/share/php/php-php-gettextto the open_basedir key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.