I'm trying to install and run PDO for sqlite3 on Ubuntu 20.04 with PHP 7.4 and I can't figure out what I'm not doing right. I installed sqlite3 and php-common and uncoment this lines in php.ini:
extension=pdo_sqlite
extension=sqlite3
When run php, i receive following result:
php -i | grep sqlite
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: /usr/lib/php/20190902/pdo_sqlite (/usr/lib/php/20190902/pdo_sqlite: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/pdo_sqlite.so (/usr/lib/php/20190902/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver)) in Unknown on line 0
/etc/php/7.4/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/7.4/cli/conf.d/20-sqlite3.ini,
sqlite3
sqlite3.defensive => 1 => 1
sqlite3.extension_dir => no value => no value
This is very strange to me because the file /usr/lib/php/20190902/pdo_sqlite.so exists. I also tested PHP7.3 and PHP7.2 and the result was the same. Switch between different versions of PHP with:
update-alternatives --config php