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โ
| Variable | Required | Description | Example |
|---|---|---|---|
WP_ENVIRONMENT_TYPE | โ | Environment type. Controls which config/environments/*.php is loaded | local, development, staging, production |
WP_ENV | โ | Legacy compat alias for WP_ENVIRONMENT_TYPE | local |
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 display | true / false |
WP_DEBUG_LOG | โ | Log errors to web/app/debug.log | true / false |
WP_CACHE | โ | Enable object caching (Redis) | true / false |
DISABLE_WP_CRON | โ | Always 1 โ cron runs externally via Ymir | 1 |
SCRIPT_DEBUG | โ | Load unminified JS/CSS | true |
Databaseโ
| Variable | Required | Description | Example |
|---|---|---|---|
DB_NAME | โ | Database name | wp_scottsdale |
DB_USER | โ | Database username | root |
DB_PASSWORD | โ | Database password | secret |
DB_HOST | โ | Single DB host (legacy; prefer reader/writer) | 127.0.0.1 |
DB_READER_HOST | โ | Aurora read replica endpoint | aurora-reader.cluster-xyz.rds.amazonaws.com |
DB_WRITER_HOST | โ | Aurora write endpoint | aurora-writer.cluster-xyz.rds.amazonaws.com |
DB_PREFIX | โ | WP table prefix (default: wp_) | wp_ |
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โ
| Variable | Required | Description | Example |
|---|---|---|---|
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 token | abc123... |
WP_REDIS_CLIENT | โ | Redis PHP client. Production: relay; local: phpredis | relay |
WP_REDIS_COMPRESSION | โ | Compression algorithm. Production: zstd; local: none | zstd |
WP_REDIS_SERIALIZER | โ | Serializer. Production: igbinary; local: php | php |
SUMA_REDIS_DATABASE_INDEX | โ | Redis database index (default: 0) | 0 |
Algolia Searchโ
| Variable | Required | Description | Example |
|---|---|---|---|
ALGOLIA_APPLICATION_ID | โ | Algolia application ID | EYDBVK6XRL |
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โ
| Variable | Required | Description |
|---|---|---|
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)โ
| Variable | Required | Description | Local Value |
|---|---|---|---|
WPMS_ON | โ | Enable WP Mail SMTP | true |
WPMS_MAIL_FROM | โ | From address | [email protected] |
WPMS_MAIL_FROM_FORCE | โ | Force from address on all emails | true |
WPMS_MAILER | โ | Mailer type | mailgun (prod), smtp (local) |
WPMS_MAILGUN_API_KEY | โ (prod) | Mailgun API key | โ |
WPMS_MAILGUN_DOMAIN | โ (prod) | Mailgun sending domain | scottsdalemint.com |
WPMS_MAILGUN_REGION | โ | Mailgun region | US |
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 locally | 1 |
Shipping (ShipStation)โ
| Variable | Required | Description |
|---|---|---|
SUMA_SHIPSTATION_API_KEY | โ | ShipStation API key |
SUMA_SHIPSTATION_API_SECRET | โ | ShipStation API secret |
Security Keysโ
| Variable | Required | Description |
|---|---|---|
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โ
| Variable | Required | Description |
|---|---|---|
MOBILE_APP_API_KEY | โ | Bearer token for mobile app REST API endpoints |
Order Configurationโ
| Variable | Required | Description | Example |
|---|---|---|---|
ORDER_PREFIX_NUMBER | โ | Prefix for order numbers | SM- (prod), LOCAL- (local) |
Plugin Licensesโ
| Variable | Required | Description |
|---|---|---|
ACF_PRO_LICENSE | โ | Advanced Custom Fields Pro license key |
WPMDB_LICENCE | โ | WP Migrate DB Pro license key |
PWP_NAME | โ | Perfmatters performance plugin identifier |
Loggingโ
| Variable | Required | Description | Default |
|---|---|---|---|
WONOLOG_DEFAULT_MIN_LEVEL | โ | Minimum log level for Wonolog | 300 (WARNING) |
Multisiteโ
| Variable | Required | Description |
|---|---|---|
WP_ALLOW_MULTISITE | โ | Enable multisite setup wizard (default: false) |
MULTISITE | โ | Enable multisite mode (default: false) |
Environment-Specific Behavior Summaryโ
| Setting | Local | Development | Staging | Production |
|---|---|---|---|---|
| Error display | On | On | Off | Off |
| AvaTax commits | Disabled | Disabled | Disabled | Enabled |
| Algolia prefix | scottsdale_local_v2_ | scottsdale_dev_ | scottsdale_stg_ | scottsdale_prod_ |
| Redis compression | none | none | zstd | zstd |
| Email routing | MailHog (port 2525) | MailHog | Mailgun | Mailgun |
| Walmart plugin | Disabled | Disabled | Disabled | Disabled |
| Kount plugin | Enabled | Enabled | Enabled | Disabled (post-deploy) |
| Memory limit | Unlimited (Herd) | 2048MB | 2048MB | 4096MB |
Updating .env Variablesโ
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.
Once done, delete any local copies of .env.[environment] to keep environment variables secure.