WordPress with SQLite

WordPress is a free open-source CMS (Content Management System) written in PHP and uses MySQL, WordPress is one of the most popular CMS, It does not support any other database other than MySQL, Due to a lack of support for any other Database, It sometimes turns into a problem when the user wants to have WordPress installed but does not have MySQL database for various reasons sometimes the Web Server is not powerful enough to handle MySQL or the hosting service does not offer MySQL in specific plans. Certain hosting services run the MySQL database in a separate data center, which can sometimes be slow to fetch the data or slow the WordPress system entirely on higher traffic.

Also, read about, My experience with WordPress SQLite.

How do we achieve this?

However, a WordPress plugin developer, kjmtsh developed a plugin, SQLite Integration which lets you run WordPress with SQLite, a file-based alternative to MySQL, which is faster and consumes fewer system resources. So now you can run WordPress with SQLite. _I have tried this plugin with a fresh WordPress install and did not try to migrate an existing MySQL-based WordPress install. So I don’t recommend trying it on an existing WordPress install with MySQL.

Getting started

Get WordPress.

First, grab a copy of WordPress from here and expand the files into Webroot or wherever your website source is stored.

Get the SQLite plugin.

Update: Original author is no longer maintaining this plugin. You can get it from this GitHub repo, or click this link here to download the zip archive of the git repo.

Now get the SQLite integration plugin from here and expand the files.

Setting up and activating the plugin.

Now place the SQLite Integration plugin folder in your wp-content/plugins directory.

Copy the db.php file found in the sqlite-integration folder to wordpress/wp-content folder.

Rename wordpress/wp-config-sample.php to wordpress/wp-config.php.

You can use these parameters to configure what the database should be named and where it should be located, by default the database is named .ht.sqlite stored in wp-content/database/

Extra setting options

SQLite database file name settings.

define('DB_FILE', 'your_database_name');  
Code language: JavaScript (javascript)

Database storage directory

define('DB_DIR', '/home/youraccount/database_directory/');  
Code language: JavaScript (javascript)

Visit your WordPress install, and you should be greeted with a setup page.

You can enable the SQLite plugin on the plugins page, visit the Miscellaneous page, and optimize the database whenever a new plugin is installed/removed or needs a database cleanup.

Optimize will drop the size of the database by only keeping the required content of posts, pages, and plugins. This will improve the performance of WordPress overall.

Now you have WordPress running on SQLite installed on your system.

If you require patches or issue tracking visit here.