I have just installed an Ubuntu Server 16.04 with Nginx, and i have installed php in this way:
sudo apt-get install php7.0-cli php7.0-cgi php7.0-fpm php7.0-curl
And for MySql i have installed percona, in this way:
apt-get install percona-server-server-5.7 percona-server-client-5.7
but I can't understand why i can't use PDO in my php script, this is my code:
$db = new PDO("mysql:dbname=db;host=localhost;charset=utf8", "username", "password");
I get this error:
Uncaught PDOException: could not find driver
I have searched online and I have found that i have to uncomment this line in Windows in php.ini:
;extension=php_pdo_mysql.dll
or this line on Linux:
;extension=php_pdo_mysql.so
I have checked my php.ini in:
/etc/php/7.0/fpm/php.ini
and i have a .dll
file and not a .so
file, I can't also understand why I have a dll instead of a so. Anyway enabling that .dll file and restarting php nothing change. Anyone can help me?
Thanks