Load a .env file at app startup so database passwords and API keys never appear in your source code.
Use layered .env files (.env.env.local.env.production) to keep local developer settings separate from what's deployed.
Install via Composer and configure in seconds to add environment-variable support to any PHP project.
Overwrite already-set environment variables by loading a second .env file for integration testing.
| symfony/dotenv | ampache/ampache | ralouphie/getallheaders | |
|---|---|---|---|
| Stars | 3,799 | 3,797 | 3,797 |
| Language | PHP | PHP | PHP |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 4/5 | 1/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Composer, install with one command, then call the load method in your app bootstrap.
This is a PHP library that reads configuration values from a special file called .env and makes them available to your application at runtime. The .env file is a plain text file where you store things like database passwords, API keys, or other settings that should not be hardcoded directly in your code. When your application starts, this library loads the .env file and places those values into PHP's built-in environment containers so the rest of your code can read them. You can load one file or several files at once, and there is an option to overwrite values that were already set before the library ran. It also supports a layered loading approach where different files apply depending on what environment your app is running in, such as development or production. This makes it straightforward to keep local settings separate from what gets deployed to a server. The library is published as a Symfony component and is installed via Composer, PHP's standard package manager. The README is intentionally short because this is a focused, single-purpose tool with no complex setup.
A PHP library that loads environment variables from a .env file into your app at startup, so you can safely store secrets like API keys and database passwords outside your codebase.
Mainly PHP. The stack also includes PHP, Composer, Symfony.
License information is not mentioned in the explanation.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.