...
Since we're using Pantheon, we'll use wp-config-local.php
instead of wp-config.php
:
Add
wp-config-ddev.php
to.gitignore
.Remove any database connection settings from
wp-config-local.php
.Add the following to the bottom of
wp-config-local.php
:
Code Block | ||
---|---|---|
| ||
// 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 | ||
---|---|---|
| ||
define( 'ADMIN_COOKIE_PATH', '/' ); define( 'COOKIEPATH', '' ); define( 'SITECOOKIEPATH', '' ); |
...