https://stackoverflow.com/questions/33682977/php-returning-pdoexception-could-not-find-driver-when-trying-to-connect-do-sql/74010959#74010959
I've had similar problem and I think it is important to give another elaborate answer on this. The root of the problem was that I built my own newest version of sqlite from sources (repo for Ubuntu 16.04 is outdated) without SQLITE_ENABLE_COLUMN_METADATA definition. It worked before I restarted the machine. Probably it's the previous version was running or something like that, because after a reboot I've got the trouble.
http://source.online.free.fr/Linux_HowToCompileSQLite.html
The SQLitePass library uses specific SQLite functions to retrieve schema information on an SQL statement.
These functions are :
sqlite3_column_database_name sqlite3_column_database_name16 sqlite3_column_table_name sqlite3_column_table_name16 sqlite3_column_origin_name sqlite3_column_origin_name16 sqlite3_table_column_metadataUnfortunately, they are not always available in the precompiled library available on the SQLite webpage or in the sqlite package dedicated to your Linux distribution.
In order to get these functions in our sqlite3.so library, we need to compile the SQLite source code with the [SQLITE_ENABLE_COLUMN_METADATA] compiler directive.
That's why less +G /var/log/php_errors.log output had the line
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: sqlite3_column_table_name in Unknown on line 0
although the pdo_sqlite was present in phpinfo(); output all the time.
To solve the problem I did follow the compilation instructions by the link above: open sqlite3.c in the sources and after the lines
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
add
#define SQLITE_ENABLE_COLUMN_METADATA
then run
$ ./configure
$ make
$ make check
make: Nothing to be done for 'check'.
$ sudo make install
$ sudo service apache2 restart
and now sqlite is working again.






