How to enable PDO driver for sqlite3 in php?

My SQLite is version 3.4.0: image

However, my phpinfo PDO support for SQLitev3 is not enabled / not specified: image

How to enable it? I installed my web server through XAMPP.

+7
source share
5 answers

I think the PDO driver for sqlite3 is called sqlite, so you already installed it. The sqlite2 driver is older.

PDO_SQLITE is a driver that implements the PHP Data Objects (PDO) interface to provide access to SQLite 3 databases.

PHP 5.1 SQLite SQLite 2 ; PDO_SQLITE, , . SQLite 2 PDO SQLite 2 SQLite 3. SQLite 2 SQLite 3.

http://php.net/manual/en/ref.pdo-sqlite.php

+6

php.ini "sqlite". , :

extension=php_pdo_sqlite.dll

extension=php_sqlite.dll

Apache.

+8

"pdo_sqlite" and "sqlite3" are different extensions and are loaded in php.iniin different lines:

extension=php_pdo_sqlite.dll

extension=php_sqlite3.dll
0
source

I fixed this problem on a Linux / Unix system by adding the following lines to php.ini:

extension=pdo_sqlite.so
extension=sqlite.so
0
source

All Articles