I've encountered this bug twice now, after upgrading ubuntu in january 2018 (probably to ubuntu 17.10) and when upgrading debian from stretch to buster.
here's what the bug is like. running things like
php -m | grep mysqli shows that
the commandline version of php can find extensions, but doing
print_r(get_loaded_extensions()); in a php file and then viewing it in the browser
shows that the extensions are not loaded in php-fpm/apache.
Here are some things that are suggested on stack overflow and similar sites, but they don't work: