# symfony/dotenv

Registers environment variables from a .env file

Repository: https://github.com/symfony/dotenv
Canonical: https://ross.abutalabs.com/products/symfony-dotenv
Homepage: https://symfony.com/dotenv
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, component, symfony-component, dotenv, env, environment
Last push: 2026-07-29T11:57:26+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 95, longevity 100
- inputs: {"age_days": 3520, "days_push": 35, "days_rel": 35, "gap_med": 0, "n_releases_24m": 42}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3788, forks 28 (observed 2026-08-28T04:08:18.680951+00:00)

## What it is
A Symfony component that parses .env files and registers the variables they contain into PHP's $_ENV and $_SERVER superglobals. It supports loading multiple files, environment-specific overrides like .env.local, and overloading existing variables.

## Use cases
- load environment variables from a .env file in PHP
- manage per-environment config with .env.local overrides
- parse dotenv files in a PHP project without Symfony framework
- keep secrets and app config out of the codebase
- load multiple env files with precedence in PHP

## When to choose
- you run a PHP application and want standard .env file support
- you need environment-specific overrides like .env.local or .env.dev
- you want a small, battle-tested component used by major PHP projects like Shopware and PrestaShop

## When to avoid
- your runtime platform already loads .env files natively (e.g. Docker, Kubernetes, some hosts)
- you need encrypted or remote secret management rather than plain .env files
- you work outside PHP

## Facets
- artifact type: library
- maturity: stable
- function: configuration-management, parser
- domain: developer-tools, web-development, backend
- platform: php, cli
- tags: dotenv, environment-variables, symfony-component, env-files, composer

## Member repositories
- symfony/dotenv (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:18.680951+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:27:28.171346+00:00, confidence not recorded.
  - readme: https://github.com/symfony/dotenv (fetched 2026-08-28T04:08:18.680951+00:00, sha 4ef37a819aa1)
  - homepage: https://symfony.com/dotenv (fetched 2026-08-29T09:22:10.416582+00:00, sha 50c2e8f89756)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T09:22:10.425574+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/doc/current/configuration.html (fetched 2026-08-29T09:22:10.428024+00:00, sha 9146f9440156)
  - site_page: https://symfony.com/projects/phpmyfaq (fetched 2026-08-29T09:22:10.431044+00:00, sha 811068e1487f)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T09:22:10.432930+00:00, sha f109a7a4a5da)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T09:22:10.435019+00:00, sha da84802d18f3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
