I managed to find a PPA with php5.6 but when installed phpmyadmin from normal ubuntu packages, everything seemed to be fine until i visited It said:

The mbstring extension is missing. Please check your PHP configuration.

Even tho I have uncommented it and restarted apache2, I still got this error which got me thinking which php.ini was phpmyadmin loading it from? Probably from a PHP 7.1 install that I don't even have so I want to ask how do I install phpmyadmin for PHP 5.6 in ubuntu 16.04 where PHP 5.6 doesn't apear in official packages anymore.

NOTE This is a fresh install of ubuntu-server 16.04.1 LTS using PPA of PHP 5.6

list of php installed packages:

root@*****:~# apt list --installed | grep php
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapache2-mod-php5.6/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed]
php-common/xenial,xenial,now 1:49+deb.sury.org~xenial+4 all [installed,automatic]
php-phpseclib/xenial,xenial,now 2.0.1-1build1 all [installed,automatic]
php5.6/xenial,xenial,now 5.6.29-1+deb.sury.org~xenial+1 all [installed]
php5.6-cli/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed]
php5.6-common/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed,automatic]
php5.6-json/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed,automatic]
php5.6-mbstring/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed]
php5.6-mcrypt/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed]
php5.6-mysql/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed]
php5.6-opcache/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed,automatic]
php5.6-readline/xenial,now 5.6.29-1+deb.sury.org~xenial+1 amd64 [installed,automatic]
phpmyadmin/xenial-updates,xenial-updates,now 4: all [installed]
  • What version of php are you using, and did you enable mbstring in apache? Jan 19 '17 at 23:04
  • For mbstring extension, try this: sudo apt-get install php5.6-mbstring. Jan 19 '17 at 23:14
  • php5.6-mbstring is already the newest version (5.6.29-1+deb.sury.org~xenial+1) I think it's phpmyadmin that is trying to use php7 when it should use php5.6 (and find mbstring is installed) and I want to know if it's possible to change this
    – eye
    Jan 20 '17 at 0:56
  • this is a fresh install of ubuntu-server 16.04 LTS I didn't change anything, the only change I did was uncommenting the mbstring line in php.ini file, everything else is default
    – eye
    Jan 20 '17 at 0:58
  • 2
    Possible duplicate of mbstring is missing for phpmyadmin in ubuntu 16.04 Jan 20 '17 at 10:56

1. In /etc/php/x.x/apache2/php.ini has a line ;extension=php_mbstring.dll. In this case, this is just an example. Files with .dll extensions are libraries for Windows. Equivalent extensions for Ubuntu are .so - check your /etc/php/5.6/mods-available/mbstring.ini for example.

The easiest way to enable PHP modules in Ubuntu is through the command phpenmod. So you need:

sudo apt-get install php5.6-mbstring
sudo phpenmod mbstring 

2. To enable PHP 5.6 for Apache2 you need to:

  • Install the library:

    sudo apt install libapache2-mod-php5.6
  • Disable php7.x modules:

    sudo a2dismod php7.0 && sudo a2dismod php7.1
  • Enable php5.6 module:

    sudo a2enmod php5.6

3. Restart Apache2:

sudo systemctl restart apache2.service

4. Check your PHP configuration:

  • Create phpinfo.php file in /var/www/html/ (if this is your DocumentRoot Directory):

    echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/phpinfo.php
  • Open phpinfo.php in your web browser, and check your current PHP configuration: http://localhost/phpinfo.php.

  • 1
    it worked but I had to install php-gettext and configure .htaccess file
    – eye
    Jan 20 '17 at 16:18

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.