Some technical aspects of VersionPress can be configured by defining constants in wp-config.php or using an associated WP-CLI command. Furthermore, VersionPress introduces a wp-config.common.php file that is required by wp-config.php and stores common (shared) configuration.

Most of the constant in wp-config.php are local, specific to a given environment. For example, database connection needs to be different on staging and production sites. Because of that, VersionPress omits wp-config.php from version control, however, some options should – or even must – be shared. For example, WP_CONTENT_DIR or WP_PLUGIN_DIR must be shared as the site structure needs to be the same on all environments.

To support this, VersionPress 3.0 introduced a wp-config.common.php file which is version-controlled and require'd by the built-in wp-config.php file. The whole system looks like this:

The constants below influence some technical aspects of how VersionPress works. You should not typically need to update them but if you do, we strongly recommend using a WP-CLI command wp vp config to do it. For example, to set a custom Git path, run:

By default, VersionPress calls just git which leaves the path resolution up to the operating system. That might be problematic on some server configurations which use different PATH for different users (the web server user might not be the same user under which you are logged in), there might be some PATH caching involved, etc. If VersionPress cannot detect Git for some reason, use this option.

By default, VersionPress creates the repository (and the .git directory) in the ABSPATH directory. If you move WordPress into its own directory, you have to define this constant to point to the original ABSPATH location. For example, if you have the site at /var/www/my-site and you move WordPress into /var/www/my-site/wordpress, the VP_PROJECT_ROOT needs to be set to /var/www/my-site (where the .git directory is).