wpstarter icon indicating copy to clipboard operation
wpstarter copied to clipboard

When using with the DDev tool WP Starter v3 doesn't recognize `WP_HOME` as being set

Open timnolte opened this issue 1 year ago • 2 comments

https://github.com/wecodemore/wpstarter/blob/ad004f7693be9c3bf3b2fbc64a48b506ff33b4c7/templates/wp-config.php#L219-L230

This file: https://github.com/ddev/ddev/blob/master/pkg/ddevapp/wordpress/wp-config-ddev.php

is being included in the ENV_VARIABLES section as so:

		// 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;
		}

timnolte avatar Feb 22 '24 19:02 timnolte

@timnolte first basic question, have you verified that getenv('IS_DDEV_PROJECT') returns "true" when the faile is loaded?

gmazzap avatar Feb 22 '24 20:02 gmazzap

@gmazzap well, so here's the thing, if we manually setup on line 225:

$home .= $_SERVER['SERVER_NAME'] ?? '<PROJECT_ID>.ddev.site';

The site loads properly along with all of the database settings. It would seem to me then that URL_CONSTANTS is being loaded before ENV_VARIABLES.

timnolte avatar Feb 22 '24 20:02 timnolte