Problem updating phpmyadmin

I use phpmyadmin via script installer. But i can not update the script. Virtualmin tries to install php5-mysql. But i use Ubuntu 16.04 with PHP7 and NGinx.

Upgrading phpMyAdmin to version 4.7.1 ..
PHP module mysql is required ..
Enabling module in PHP configuration ..
.. done
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!
Module is not available even after installation!
Status: 
Active

Comments

Is there a php-mysql package available for installation on your system?

Yes it is. And it is already installed.

It looks like Virtualmin isn't detecting it as installed. Which PHP execution mode do you have selected for this domain?

Oh, this is strange... I am using nginx. I configured the server to run php as php-fpm. But now when i check the mode under "server configutation" --> "Website options" there is only an option to run php as FCGId (See this screenshot: http://imgur.com/a/VWfmO)

What output do you get if you run :

PHPRC=/home/yourdomain/etc php -m

is mysql included in the list?

This is the output:

root@server01:~# PHPRC=/home/gnilebein.de/etc php -m | grep mysql
mysqli
mysqlnd
pdo_mysql

But i am wondering. Why i can not select php-fpm as PHP script execution mode? I have two servers. And it is the same issue on both (Ubuntu 16.04, PHP7, Nginx)

Ok, it looks like the problem is that mysqli is listed but not mysql.

If you edit /home/gnilebein.de/etc/php.ini, is there an extension=mysql.so (or similar) line?

I made some other test. I created an info.php file an check the path for the php.ini. It seems that the server does not use the php.ini from /home/gnilebein.de/etc/php.ini. The server use the php.ini from /etc/php/7.0/fpm/php.ini:

Then i checked the moduls for this php.ini:

root@server01:~# PHPRC=/etc/php/7.0/fpm php -m | grep mysql                                                                          
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysql.so' - /usr/lib/php/20151012/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
mysqli
mysqlnd
pdo_mysql

Is the reason because I use php-fpm?

Ok, there's your problem. What's the actual location of mysql.so on your system?

PHP7.0 is shipped with Ubuntu 16.04 LTS. PHP7 does not offer old mysql support. So there is no mysql.so.

Is there any reference to /usr/lib/php/20151012 in the php.ini file though? The issue may be that PHP modules are being loaded from the wrong directory.

No there is no reference. I did one more test. I switched the php exec mode from fpm to fcgi and it works without any problem. The issue only occurs in fpm mode.

Do you have any idea why?