We use a wp-config-local.php for our local environments. The wp-config.php automatically loads wp-config-local.php if it exists. This works fine, except when we try to run WP-CLI commands.
When we attempt to run a WP-CLI command, we get an error about a database connection.
When I look at the “Database” tab in local, it is unable to find most of the values because it is looking in wp-config.php (instead of wp-config-local.php).
Is there a way to tell Local to use wp-config-local.php? Or another work around for this?
I simply commented out require_once(ABSPATH . 'wp-settings.php'); in wp-config-local.php (and left it as-is in wp-config.php ). This solved my wp-cli problem and doesn’t appear (so far) to have any adverse effects (since wp-settings.php does still get loaded in wp-config.php )