1

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 0.0.0.0/phpmyadmin. 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:4.5.4.1-2ubuntu2 all [installed]
eye
  • 13

1 Answers1

1

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.

pa4080
  • 30,621