5
suvo@Suvodip-Lenovo ~ $ sudo apt install php-mysqli

[sudo] password for suvo:

Reading package lists... Done`enter code here`

Building dependency tree    

Reading state information... Done

Package php-mysqli is a virtual package provided by:

php7.3-mysql 7.3.2-3+ubuntu16.04.1+deb.sury.org+1

php7.2-mysql 7.2.15-1+ubuntu16.04.1+deb.sury.org+1

php7.1-mysql 7.1.26-1+ubuntu16.04.1+deb.sury.org+1

php5.6-mysql 5.6.40-1+ubuntu16.04.1+deb.sury.org+1

php7.0-mysql 7.0.33-1+ubuntu16.04.1+deb.sury.org+1

You should explicitly select one to install.

E: Package `php-mysqli` has no installation candidate
noetix
  • 4,773
  • 3
  • 26
  • 47
Suvodip Mondal
  • 93
  • 1
  • 1
  • 6
  • 1
    The message is very clear: *"You should explicitly select one to install."* Install the most recent one - 7.3. – Pinke Helga Feb 13 '19 at 05:14

1 Answers1

4

Understand the error message

Package php-mysqli is a virtual package provided by:
[...]

The apt package management uses virtual packages to fulfill dependencies. A virtual package itself has no content at all. It cannot be installed directly. It is meant as an indicator that the expected software was installed to signal other packages that their dependencies are resolved.

apt tells you a list of real packages which install the virtual one. Just install the most recent one (or, if you alread have installed another PHP version, the matching version):

sudo apt install php7.3-mysql
Pinke Helga
  • 6,378
  • 2
  • 22
  • 42
  • I have tried this sudo apt install php8.2-mysql and I got this reply php8.2-mysql is already the newest version (8.2.5-1+ubuntu20.04.1+deb.sury.org+1). but still getting same error – Naren Verma May 03 '23 at 11:56
  • @NarenVerma That means, `php8.2-mysql` is already installed. You should find `mysqli.ini` in /etc/php/8.2/mods-available. You might need a `sudo phpenmod mysqli` to enable it. Remember to restart Apache. – Pinke Helga May 03 '23 at 19:19
  • Tried but still same issue. – user9437856 May 05 '23 at 13:50
  • @user9437856 you should open a new question and describe, what your issue exactly is. – Pinke Helga May 05 '23 at 17:40