0

I do have php7.4-mysql installed, the error is here below and the rest is in the title

PHP Fatal error: Uncaught Error: Class 'mysqli' not found in {long_path}/index.php:9\nStack trace:\n#0 {main}\n thrown in {long_path}/index.php on line 9

Is there a solution to this or do I have to reinstall and reconfigure everything (which means I will just downgrade to Ubuntu 18.04 again via backups)?

Paulo Boaventura
  • 1,365
  • 1
  • 9
  • 29
Kelvin Bouma
  • 179
  • 1
  • 2
  • 12

2 Answers2

1

I had the same problem after an update today. I figured something was messed up so I tried to remove it

apt remove php-mysqli
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'php7.4-mysql' instead of 'php-mysqli'
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

I then tried a purge, and install exact same result.

Finally, apt-get dist-upgrade fixed my problem.

You can see the upgrade left my system is a weird state that wasn't fully flushed out.

apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  apt-show-versions libapt-pkg-perl libauthen-pam-perl libimagequant0 libio-pty-perl libnet-ssleay-perl libpython-all-dev libpython2-dev
  libpython2.7-dev libwebpdemux2 perl-openssl-defaults python-all python-all-dev python-automat python-certifi python-configparser python-constantly
  python-crypto python-dbus python-entrypoints python-gi python-hyperlink python-keyring python-olefile python-pil python-xdg python2-dev python2.7-dev
  python3-scour scour
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libapache2-mod-php7.2 libapache2-mod-php7.3 libpcre2-posix0 libpython-dev libpython-stdlib minecraft-overviewer php7.2 php7.3 python python-click
  python-colorama python-configobj python-dev python-incremental python-keyrings.alt python-minimal python-pip python-requests python-scour
  python-secretstorage python-serial python-twisted-bin python-twisted-core python-urllib3 python-wheel webmin
The following NEW packages will be installed:
  libapache2-mod-php7.4 libpcre2-posix2 php7.4
The following packages have been kept back:
  libomp-dev
The following packages will be upgraded:
  libapache2-mod-php libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-dev libpython-all-dev libpython2-dev libpython2-stdlib php python-all
  python-all-dev python-pip-whl python2 python2-dev python2-minimal python3-pip
16 upgraded, 3 newly installed, 26 to remove and 1 not upgraded.
Need to get 2,675 kB/4,704 kB of archives.
After this operation, 196 MB disk space will be freed.
Do you want to continue? [Y/n] y

After that I refreshed my page and it was working again.

Hopefully this helps and you are not alone.

RRiVEN
  • 2,519
  • 2
  • 14
  • 13
0

Upgrading php to 7.4 worked for me.

sudo apt-get install php7.4
Confused
  • 1,602
  • 15
  • 25