phpmyadmin not working due to missing extensions

I am about to use phpmyadmin on Ubuntu 16.04. But it shows that the page is not working. the error log says error 500

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

At first it says that the mysqli|mysql extension is missing. but after sleepless hours I forget what I've been done to it. I am using php7.


sudo apt-get install php-mbstring php7.0-mbstring php-gettext

or simply:

sudo apt-get install php-gettext

and then:

sudo service apache2 restart

This has been reported at this bug:

  • https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/1577482

You need to install php-gettext , Install it using

 sudo apt-get install php-gettext

I lost hours to solve this problem. Just install php-mbstring, php7.0-mbstring and php-gettext. That's it.

You can do that by running the following command:

sudo apt-get install php-mbstring php7.0-mbstring php-gettext

In my case, my problem was with the folder creation. When I was installing the php-gettext lib with:

sudo apt-get install php-gettext

Two folders are created in usr/share/php

Folder 1 - usr/share/php/php-gettext
Folder 2 - usr/share/php/php-phpgettext

And inside the first folder some symbolic links to the second folder.

I deleted the first folder with:

sudo rm -r usr/share/php/php-gettext

And then copy the php-php-gettext folder to php-gettext with:

sudo cp -r php-php-gettext php-gettext

Now my phpmyadmin works.