Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Since we're using Pantheon, we'll use wp-config-local.php instead of wp-config.php:

  1. Add wp-config-ddev.php to .gitignore.

  2. Remove any database connection settings from wp-config-local.php.

  3. Add the following to the bottom of wp-config-local.php:

Code Block
languagephp
// Include for ddev-managed settings in wp-config-ddev.php.
$ddev_settings = dirname(__FILE__) . '/wp-config-ddev.php';
if (is_readable($ddev_settings) && !defined('DB_USER')) {
  require_once($ddev_settings);
}

...


⚠️ Important: Most of the time if not all the time! , you would be experiencing login problems, such as the inability to log in due to the cookie issues. from From here, you need to play with the cookie settings in wp-config-local.php for example trying to set define( 'COOKIE_DOMAIN', 'your-local-ddev-site.ddev.site:447' ); which in most cases you would see the warning about the constant being already defined in wp-config.php. Then simply set these in wp-config-local.php:

Code Block
languagephp
define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIEPATH', '' );
define( 'SITECOOKIEPATH', '' );

...