Skip to main content

Environment Variables Reference

All environment configuration is loaded from the .env file at the repository root using vlucas/phpdotenv. The full configuration loading happens in config/application.php.

Copy .env.example to .env and populate values for your environment.


WordPress Coreโ€‹

VariableRequiredDescriptionExample
WP_ENVIRONMENT_TYPEโœ…Environment type. Controls which config/environments/*.php is loadedlocal, development, staging, production
WP_ENVโœ…Legacy compat alias for WP_ENVIRONMENT_TYPElocal
WP_HOMEโœ…The public-facing site URL (no trailing slash)https://scottsdalemint.com
WP_SITEURLโœ…WordPress admin URL โ€” always includes /wp suffix (Bedrock)https://scottsdalemint.com/wp
WP_DEBUGโ€”Enable PHP error displaytrue / false
WP_DEBUG_LOGโ€”Log errors to web/app/debug.logtrue / false
WP_CACHEโ€”Enable object caching (Redis)true / false
DISABLE_WP_CRONโœ…Always 1 โ€” cron runs externally via Ymir1
SCRIPT_DEBUGโ€”Load unminified JS/CSStrue

Databaseโ€‹

VariableRequiredDescriptionExample
DB_NAMEโœ…Database namewp_scottsdale
DB_USERโœ…Database usernameroot
DB_PASSWORDโœ…Database passwordsecret
DB_HOSTโ€”Single DB host (legacy; prefer reader/writer)127.0.0.1
DB_READER_HOSTโœ…Aurora read replica endpointaurora-reader.cluster-xyz.rds.amazonaws.com
DB_WRITER_HOSTโœ…Aurora write endpointaurora-writer.cluster-xyz.rds.amazonaws.com
DB_PREFIXโ€”WP table prefix (default: wp_)wp_
Aurora in Production

Production uses Amazon Aurora MySQL with separate read/write endpoints. Locally, both reader and writer can point to 127.0.0.1.


Redis / Object Cacheโ€‹

VariableRequiredDescriptionExample
WP_REDIS_HOSTโœ… (prod/stg)Redis hostname (or use YMIR_REDIS_ENDPOINT)redis.internal
YMIR_REDIS_ENDPOINTโ€”Auto-set by Ymir in deployed environmentsโ€”
WP_REDIS_TOKENโœ… (prod/stg)Redis AUTH tokenabc123...
WP_REDIS_CLIENTโ€”Redis PHP client. Production: relay; local: phpredisrelay
WP_REDIS_COMPRESSIONโ€”Compression algorithm. Production: zstd; local: nonezstd
WP_REDIS_SERIALIZERโ€”Serializer. Production: igbinary; local: phpphp
SUMA_REDIS_DATABASE_INDEXโ€”Redis database index (default: 0)0

VariableRequiredDescriptionExample
ALGOLIA_APPLICATION_IDโœ…Algolia application IDEYDBVK6XRL
ALGOLIA_API_KEYโœ…Admin API key (server-side only)47f08c8...
ALGOLIA_SEARCH_API_KEYโœ…Search-only API key (public-safe)8fcc216...

The index name prefix is not set here โ€” it is environment-specific and configured automatically in config/environments/*.php:

  • Production: scottsdale_prod_
  • Staging: scottsdale_stg_
  • Development: scottsdale_dev_
  • Local: scottsdale_local_v2_

NFusion Pricingโ€‹

VariableRequiredDescription
NFUSION_API_KEYโœ…NFusion order/data API key
NFUSION_PRODUCT_API_KEYโœ…NFusion product catalog API key
NFUSION_PRODUCT_CATALOG_BASE_URLโœ…NFusion catalog base URL
NODE_ENVโ€”Node environment (for NFusion chart widget)

Email (Mailgun / WP Mail SMTP)โ€‹

VariableRequiredDescriptionLocal Value
WPMS_ONโ€”Enable WP Mail SMTPtrue
WPMS_MAIL_FROMโ€”From address[email protected]
WPMS_MAIL_FROM_FORCEโ€”Force from address on all emailstrue
WPMS_MAILERโœ…Mailer typemailgun (prod), smtp (local)
WPMS_MAILGUN_API_KEYโœ… (prod)Mailgun API keyโ€”
WPMS_MAILGUN_DOMAINโœ… (prod)Mailgun sending domainscottsdalemint.com
WPMS_MAILGUN_REGIONโ€”Mailgun regionUS
WPMS_SMTP_HOSTโ€”Local SMTP host (MailHog)127.0.0.1
WPMS_SMTP_PORTโ€”Local SMTP port (MailHog)2525
YMIR_DISABLE_EMAIL_SENDINGโ€”Set to 1 to suppress all emails locally1

Shipping (ShipStation)โ€‹

VariableRequiredDescription
SUMA_SHIPSTATION_API_KEYโœ…ShipStation API key
SUMA_SHIPSTATION_API_SECRETโœ…ShipStation API secret

Security Keysโ€‹

VariableRequiredDescription
WP2FA_ENCRYPT_KEYโœ…Encryption key for 2FA secrets
SENSITIVE_DATA_KEYโœ…Encryption key for sensitive customer data
AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEYโœ…WordPress salt keys
AUTH_SALT, SECURE_AUTH_SALT, LOGGED_IN_SALT, NONCE_SALTโœ…WordPress salts

Mobile Appโ€‹

VariableRequiredDescription
MOBILE_APP_API_KEYโœ…Bearer token for mobile app REST API endpoints

Order Configurationโ€‹

VariableRequiredDescriptionExample
ORDER_PREFIX_NUMBERโœ…Prefix for order numbersSM- (prod), LOCAL- (local)

Plugin Licensesโ€‹

VariableRequiredDescription
ACF_PRO_LICENSEโœ…Advanced Custom Fields Pro license key
WPMDB_LICENCEโ€”WP Migrate DB Pro license key
PWP_NAMEโ€”Perfmatters performance plugin identifier

Loggingโ€‹

VariableRequiredDescriptionDefault
WONOLOG_DEFAULT_MIN_LEVELโ€”Minimum log level for Wonolog300 (WARNING)

Multisiteโ€‹

VariableRequiredDescription
WP_ALLOW_MULTISITEโ€”Enable multisite setup wizard (default: false)
MULTISITEโ€”Enable multisite mode (default: false)

Environment-Specific Behavior Summaryโ€‹

SettingLocalDevelopmentStagingProduction
Error displayOnOnOffOff
AvaTax commitsDisabledDisabledDisabledEnabled
Algolia prefixscottsdale_local_v2_scottsdale_dev_scottsdale_stg_scottsdale_prod_
Redis compressionnonenonezstdzstd
Email routingMailHog (port 2525)MailHogMailgunMailgun
Walmart pluginDisabledDisabledDisabledDisabled
Kount pluginEnabledEnabledEnabledDisabled (post-deploy)
Memory limitUnlimited (Herd)2048MB2048MB4096MB

Updating .env Variablesโ€‹

caution

Changing a .env variable alone will NOT update the live site. You must redeploy the environment for changes to take effect.

All commands are done via ymir

Step 1: Audit .env

ymir environment:variables:download [environment]

Creates a file named .env.[environment] (e.g., .env.staging) so you can verify existing keys. It will not overwrite your local .env.

Step 2: Change

Make your changes to the downloaded file.

ymir environment:variables:upload [environment] [KEY_NAME] [VALUE]

What it does: Sends the new value directly to the Ymir API.

Step 3: Sync

Re-deploy the [environment] where .env variables were updated.

caution

Once done, delete any local copies of .env.[environment] to keep environment variables secure.