Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Environment variables

Every environment variable the DXP skeleton's guide documents - application, database (MySQL, PostgreSQL, SQLite), JWT, search engine, HTTP cache, application cache, mail, sessions and CORS - and the rules for keeping…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/dxp-developers/environment-variables.md

On this page

Environment variables

This page is for developers who configure a DXP project. A Symfony project reads its settings from environment variables; the skeleton keeps defaults in .env and your host's values in .env.local. All variables below are the ones the skeleton's guide (section 4) documents.

Contents

  1. The files and the rule
  2. Application
  3. Database
  4. JWT
  5. Search, cache, mail and the rest
  6. Keeping a reference without secrets
  7. Checking what Symfony sees

The files and the rule

FileCommittedHolds
.envyesDefaults without secrets
.env.localneverThis host's values and secrets
.env.local.dist (optional)yesA copy of .env.local with every secret redacted, as a reference

Real environment variables set by the web server or the process manager win over the files.

Application

APP_ENV=prod                  # or dev
APP_SECRET=<32 random hex characters>

APP_DEBUG and APP_HTTP_CACHE are set in the web server configuration in the guide's examples (Web server setup).

Database

MySQL or MariaDB from parts:

DATABASE_DRIVER=pdo_mysql
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
DATABASE_NAME=your_db_name
DATABASE_USER=your_db_user
DATABASE_PASSWORD=your_db_password
DATABASE_CHARSET=utf8mb4
DATABASE_COLLATION=utf8mb4_unicode_520_ci
DATABASE_VERSION=mariadb-10.6.0    # or 8.0 for MySQL

PostgreSQL uses DATABASE_DRIVER=pdo_pgsql, port 5432, DATABASE_CHARSET=utf8 and DATABASE_VERSION=16. A full DSN in DATABASE_URL replaces the parts. SQLite uses only the DSN and a synchronous messenger transport:

DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
MESSENGER_TRANSPORT_DSN=sync://

Details: Databases, SQLite for development.

JWT

JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=<64 random hex characters>

The key files are generated per installation and never committed (JWT authentication).

Search, cache, mail and the rest

VariableDefault in the guideOther valuesPage
SEARCH_ENGINElegacy (the database search engine)solr, with SOLR_DSN and SOLR_CORESearch
HTTPCACHE_PURGE_TYPElocalvarnishHTTP cache
HTTPCACHE_DEFAULT_TTL86400seconds
HTTPCACHE_PURGE_SERVERhttp://localhost:80the Varnish address
HTTPCACHE_VARNISH_INVALIDATE_TOKEN, TRUSTED_PROXIESunsetwith Varnish
CACHE_POOLcache.tagaware.filesystemcache.redis with CACHE_DSNApplication cache
MAILER_DSNnull://null (no delivery)smtp://localhost:25
IMAGEMAGICK_PATH/usr/binImage variations
CORS_ALLOW_ORIGINlocalhost patternyour client originsHeadless with the DXP
SESSION_HANDLER_ID, SESSION_SAVE_PATHnative file sessions under var/sessions/

For test mail in development keep MAILER_DSN=null://null, and use example.invalid addresses for test users, so no mail reaches a real person.

Keeping a reference without secrets

cp .env.local .env.local.dist
$EDITOR .env.local.dist          # replace every password, secret and passphrase with a placeholder
git add .env.local.dist

Read the file once more before you commit it.

Checking what Symfony sees

php bin/console debug:dotenv               # which files were loaded and the values they set
php bin/console debug:container --env-vars # environment variables used by the container

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x