Registry / config / vlucas-phpdotenv

vlucas-phpdotenv

JSON →
library5.6.3phppackagistunverified

Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.

composer require vlucas/phpdotenv
INSTALL
IMPORT
SIG · VLUCAS-PHPDOTENV
V
vlucas-phpdotenv
configphpv5.6.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Dotenv
use Dotenv\Dotenv;

Load environment variables from a .env file.

use Dotenv\Dotenv; $dotenv = Dotenv::createImmutable(__DIR__); $dotenv->load(); $dbHost = $_ENV['DB_HOST'];
Debug
Known issues
gotchaUsing `createMutable()` can overwrite existing environment variables; prefer `createImmutable()`.
fix
Use `Dotenv::createImmutable()` to avoid overwriting.
affects: >=5.0.0
Upgrade
Version history
5.6.3latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
26
Amazon
1
Resources
vlucas-phpdotenv — pip install vlucas-phpdotenv · libregistry