Database configuration

By default, the configuration for the MySQL database connection is set correctly in the base install for Wordpress on Hyperlane. In some cases however, this configuration may be lost due to an update or custom changes made to the wp-config.php file. This may also occur when you are importing an existing codebase to your Hyperlane site. If you need to restore this configuration, you can follow the steps below.

Wordpress config file

In order to make the database configuration work for your Hyperlane website, the process is fairly simple. All you need to do is make sure your wp-config.php file includes a Hyperlane-generated config file. This will make sure environment variables with the database credentials will be used for the connection.

Danger

Always avoid committing any credentials to your code repository. Hyperlane's configuration using environment variables ensures you don't have to.

  • Open the wp-config.php file in your favorite text editor / IDE.
  • Check the start of the file, and make sure it looks like this:
<?php
include '/opt/config/wp-config.env.php';
  • Save the file and commit to your code repository
  • Run a deployment for your Hyperlane website

Note

The file /opt/config/wp-config.env.php is managed by Hyperlane and is stored outside of your docroot.