Manual:SQLite

SQLite support for MediaWiki is mostly functional as of MediaWiki 1.16, but still in active development. Since MediaWiki version 1.13 the SQLite support is part of the main code-base. There are some notes below on installing the SQLite library into your PHP environment. The development notes and future plans are at MediaWikiLite.

About SQLite
The following description is from SQLite. Unlike client-server database management systems, the SQLite engine is not a standalone process with which the program communicates. Instead, the SQLite library is linked in and thus becomes an integral part of the program. The program uses SQLite's functionality through simple function calls, which reduces latency in database access as function calls are more efficient than inter-process communication. The entire database (definitions, tables, indices, and the data itself) is stored as a single cross-platform file on a host machine. This simple design is achieved by locking the entire database file at the beginning of a transaction.

SQLite was created by D. Richard Hipp, who sells training, direct technical support contracts and add-ons such as compression and encryption. The source code for SQLite is in the public domain.

SQLite installation
Although all SQLite versions above 3.1.2 (required for ADD COLUMN) are supported, SQLite 3.6 is recommended, as it has some data integrity bugs fixed. Also, in order to use full text search, SQLite must be compiled with FTS3 module enabled (most builds have it out of the box these days). SQLite3 works via PHP's PDO functions.


 * To install SQLite3 on a Debian based system, use apt-get install php5-sqlite3.
 * Since PHP 5.1.0, SQLite depends on PDO. You should uncomment the following two lines in your  (note: sometimes you can't even use   to check if they are present, because an SQLite-enabled PHP tend to crash or fail when PDO is absent, especially on Windows):
 * (or  for Windows)
 * (or  for Windows)

Installing MediaWiki on SQLite backend

 * If SQLite module for PHP is properly installed, MediaWiki installer (/config/index.php) should offer you an option to use SQLite. On MediaWiki versions prior to 1.16, you need to enter something into the "DB username" and "DB password" fields for installer to continue even though SQLite does not need them.
 * If you enter nothing into the "SQLite data directory" field, your $wgSQLiteDataDir will be left empty, which corresponds to data directory in the parent of the document root, however this directory might be different for web scripts and maintenance scripts run from command line, so specifying it explicitly is recommended.

Search engine
Search capabilities for SQLite backend will be released in MediaWiki 1.16. They require SQLite with FTS3 module compiled-in, which is usually present in most modern builds. If you've recently updated your SQLite support to a version that includes FTS3, run the updater as if you're upgrading MediaWiki. After the updater script created the search index table, populate it with rebuildtextindex.php. Same applies to switches back to environments without FTS3: re-running the updater will downgrade the table to avoid SQL errors.

Known problems
See this tracking bug. If you can't find your problem in this bug's dependencies, please file a new one.