PHP with pdo-mysql in ubuntu 16.04

Solution 1:

I solved the problem this way:

sudo apt-get --purge remove php-common

sudo apt-get install php-common php-mysql php-cli

Now there is no error and php -m shows it has everything:

[PHP Modules]
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Still don't know what caused the issue in the first place