TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
Using Environment Variables in Site Configuration¶
Environment Variables in site configuration allows setting placeholders for configuration options that get replaced by environment variables specific to the current environment.
The format for environment variables is
%env(ENV_NAME)%. Environment variables may be used to replace
complete values or parts of a value.
When using environment variables in conditions, make sure to quote them correctly:
condition: '"%env(my_env)%" == "my_comparison_string"'
Since TYPO3 v10.2 it's also possible to use env variables in imports:
TYPO3 does not provide a loader for .env files - you have to take care of loading them yourself. Common options include setting environment configuration via server configuration or using vlucas/phpdotenv.