ssnepenthe / wp-sqlite-starter
Starter repo for WordPress with Composer and SQLite
Package info
github.com/ssnepenthe/wp-sqlite-starter
Type:project
pkg:composer/ssnepenthe/wp-sqlite-starter
Requires
- ext-hash: *
- ext-json: *
- ext-pdo: *
- ext-pdo_sqlite: *
- composer/installers: ^2.3
- roots/bedrock-autoloader: ^1.1
- roots/wordpress: *
- wp-plugin/sqlite-database-integration: *
- wp-theme/twentytwentyfive: *
README
Get a local WordPress environment up and running quickly with Composer and SQLite.
Usage
Installation is demonstrated below with WP-CLI but you can just as easily make manual updates to composer.json and public/wp-config.php, configure and start your server, and run the standard web installer.
$ composer create-project ssnepenthe/wp-sqlite-starter /path/to/project
It is important to update salts before going any further:
$ wp config shuffle-salts
Optionally you may want to make some other updates to your site config. For example:
WP_SQLITE_AST_DRIVERcan be used to enable the new AST-based SQLite driver.SQLITE_JOURNAL_MODEcan be used to set the SQLite journal mode.WP_DEBUGcan be used enable debug mode. When set totruethe defaultwp-config.phpfile will also setWP_DEBUG_LOG,SAVEQUERIES,WP_DEBUG_DISPLAY,WP_DISABLE_FATAL_ERROR_HANDLER, andSCRIPT_DEBUG.
$ wp config set WP_SQLITE_AST_DRIVER true --raw $ wp config set SQLITE_JOURNAL_MODE WAL $ wp config set WP_DEBUG true --raw
Run the WordPress installer and enable pretty permalinks (substitute your preferred permalink structure):
$ wp core install --url=localhost:8080 --title='My Title' --admin_user=admin --admin_email=admin@example.com --skip-email
$ wp rewrite structure /%postname%/
And finally start the server:
$ wp server
Notes
- If you need to modify the host or port to the install and server commands above, make sure to update the
WP_HOME,WP_SITEURL, andWP_CONTENT_URLconstants inpublic/wp-config.php. - It can be beneficial to run the WP-CLI server with multiple workers:
PHP_CLI_SERVER_WORKERS=4 wp server - For the moment, all composer dependencies are installed with the loosest version constraint (
*). This will likely change in the future as this repo is finalized. In the meantime, you may wish to modify the version constraints incomposer.jsonbefore runningcomposer install.