Problem with SERVER_SECRET_DB_PASSWORD in Non-Standard WordPress Setup

I’ve followed the documentation source.kinsta.com/docs/wordpress-hosting/php/wordpress-php-constants/ to define the SERVER_SECRET_DB_PASSWORD in my Bedrock WordPress setup, but I’m facing database connection issues.

Here’s how I’ve defined the constants in config.php:

php

define('DB_NAME', SERVER_SECRET_DB_NAME);
define('DB_USER', SERVER_SECRET_DB_USER);
define('DB_PASSWORD', SERVER_SECRET_DB_PASSWORD);
define('DB_HOST', SERVER_SECRET_DB_HOST);

Despite this, the database connection fails when cloning staging to live or restoring backups.

Does anyone know if there’s an additional step required for non-standard setups like Bedrock? Or is there a specific way to ensure Kinsta detects these constants correctly? Any help would be appreciated!

Hello Brett,

It’s interesting to hear that this doesn’t seem to be working for you when cloning staging to live or restoring a backup.

If the backup is restored from a date and time prior to when you set this up, this would revert your changes to config.php (and it would stay that way unless you manually update it or have some automatic deployment set up to fix it).

I did test adding the following in wp-config.php in a live environment and then pushing that live environment into a staging environment. It seemed to still work on the staging environment after the push.

define('DB_PASSWORD',SERVER_SECRET_DB_PASSWORD);

I would encourage you to reach out to us in a live chat in MyKinsta or send us an email at support@kinsta.com so that we can review the site and take a look at this in more detail. The support we can provide for alternative setups like Bedrock is somewhat limited but we definitely at least want to make sure that the PHP constants that we are providing work correctly.

Thank you and we look forward to hearing from you!