NextCloud 13 Fresh Install - PHP Startup Unable to load dynamic library pdo_mysqli.so

This is the error I’m getting in my NextCloud log, and a similar error in my apache error.log

PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20160303/pdo_mysqli.so’ - /usr/lib/php/20160303/pdo_mysqli.so: cannot open shared object file: No such file or directory at Unknown#0

Everything in NextCloud appears to be working fine, but I want to resolve the issue.

I have a new installation of NextCloud 13.0.0 installed on an Ubuntu 16.04 VM. With PHP 7.1, (initially installed mysql server) then installed MariaDB (without removing my mysql)

This is the output from php -m
apc
apcu
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
imagick
intl
json
libxml
mbstring
mcrypt
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

And this is the output from apachectl -M

core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
headers_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php7_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)

Any Help would be great. (ps this is my first post, so apologies if I haven’t followed the “correct” format). Also, if I have any unnecessary php or apache modules loaded, let me know.

ps, I haven’t changed anything major in php.ini apart from things like memory limits and max upload values. I have had a quick look online, and someone suggested to add the following lines to php.ini (then restart apache using service apache2 restart), but still the same errors

extension=pdo_mysql.so
extension=pdo_mysqli.so
extension=pdo.so

As far as I know, there is no pdo_mysqli module, just pdo_mysql (as you can see in your list) and mysqli (which is not needed by Nextcloud).

So as the module you need is active, you don’t need to add any line to php.ini (the module loading is done within /etc/php/7.1/mods-available/ files btw). Especially extension=pdo_mysqli.so should be wrong and causing errors, so maybe it is the actual reason for what you face, otherwise (if this line was a solution attempt and not the cause), then maybe there is another typo like this somewhere inside your php configuration files. Then try phpdismod pdo_mysqli or review the mysql related files within the modules folder above for mentioned typo.