Enabling sqlite3 in php7
I want to enable sqlite3 in php.ini but when I try to load a PHP script this error happens:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/sqlite.so' - /usr/lib/php/20151012/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pdo_sqlite.so' - /usr/lib/php/20151012/pdo_sqlite.so: undefined symbol: php_pdo_unregister_driver in Unknown on line 0
But the library in this path exists
/usr/lib/php/20151012/sqlite.so
In only change this line in my php.ini
extension=pdo_sqlite.so
My OS is: Debian GNU/Linux 9.4 (stretch)
Make sure the correct package is installed and apache restarted after:
sudo apt install php7.0-sqlite3
sudo systemctl restart apache2
If that didn't work:
Then, correct the name for the extension in php.ini
to:
extension=sqlite3.so
extension=pdo_sqlite.so
And restart apache again: sudo systemctl restart apache2