When only PHP 7.0 is installed on Ubuntu 16.04, PhpMyAdmin script install fails

When only PHP 7.0 is installed on Ubuntu 16.04, PhpMyAdmin script install fails

php7.0-mysql is installed on the system, but Virtualmin does not see it. and fails installation with:

PHP module mysql is required ..

    Installing package php5-mysql ..
    Installing package(s) with command apt-get -y -f install php5-mysql ..

    Reading package lists...
    Building dependency tree...
    Reading state information...
    Package php5-mysql is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'php5-mysql' has no installation candidate

    .. install failed!
Status: 
Active

Comments

If you go to System Settings -> Re-Check Configuration, what PHP versions does Virtualmin detect?

Hi Jamie, It shows something strange:

The following PHP versions are available : 7.0.30 (/usr/bin/php5-cgi), 7.0.30 (/usr/bin/php-cgi7.0), 7.0 (mod_php)

PHP-FPM support is available on this system.

PHP versions have changed to 5, 7.0, 7.0 since last check. Regenerating any missing php.ini files.

And when looking at "Server Configuration" - "PHP Version" it shows choice of "7.0.30" and "7.0.30". But no PHP 5. And I don't want PHP 5 on that server anyway. Was now wondering from where it got the PHP 5 information above. And found it:

There are instructions on 14.04 to 16.04 upgrade here: https://www.virtualmin.com/documentation/system/os/ubuntu-trusty-to-xenial

to do a ln -s /usr/bin/php-cgi /usr/bin/php5-cgi

I removed then symbolic link, rechecked config and got correctly:

The following PHP versions are available : 7.0.30 (/usr/bin/php-cgi7.0), 7.0 (mod_php)

PHP-FPM support is available on this system.

PHP versions have changed to 7.0, 7.0 since last check. Regenerating any missing php.ini files.

That fixed the "bug" for installing PhpMyAdmin.

Then to remove the mod_php variant of PHP 7.0.30 without affecting running sites. Just uninstalled libapache2-mod-php7.0 to only leave the FPM variant, that fixed also the strange double-choice

For me, the issue I had is now solved. Thanks for pointing into the right direction.

So there is a main bug in the So the bug here is the wrong/outdated? Ubuntu 14.04->16.04 upgrade documentation here: https://www.virtualmin.com/documentation/system/os/ubuntu-trusty-to-xenial

And a minor UI bug in the double-7.0.30 dropdown that doesn't detail the difference of the 2 variants.