PHPackages                             env/dotenv - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. env/dotenv

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

env/dotenv
==========

A simple, tiny and lightweight PHP .env loader

v2.0.0(2y ago)07382MITPHPPHP ^8

Since May 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sabroan/php-dotenv)[ Packagist](https://packagist.org/packages/env/dotenv)[ RSS](/packages/env-dotenv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (2)

Dotenv
======

[](#dotenv)

A simple and tiny PHP `.env` loader, which does not inject values into `$_ENV` or OS.

Installation
------------

[](#installation)

```
composer require env/dotenv

```

Usage
-----

[](#usage)

The .env file should have a valid [.ini](https://wikipedia.org/wiki/INI_file) syntaxis, supported by [parse\_ini\_file](https://www.php.net/manual/en/function.parse-ini-file.php).

This package does not inject values into global `$_ENV` or OS wia [putenv()](https://www.php.net/manual/en/function.putenv.php) so it's up to you how you wan't proceed with parsed data.

### Load

[](#load)

Parse `.env` and get values as array:

```
$env = \Env\Dotenv::toArray(
    path: '.env',
    strict: false, // by default: true
);
```

If you need variables and fallback values, set strict to `false`

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~97 days

Total

2

Last Release

1001d ago

Major Versions

v1.0.0 → v2.0.02023-08-21

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/37858495?v=4)[Serhii Babinets](/maintainers/Sabroan)[@sabroan](https://github.com/sabroan)

---

Top Contributors

[![sabroan](https://avatars.githubusercontent.com/u/37858495?v=4)](https://github.com/sabroan "sabroan (3 commits)")

---

Tags

environmentenvdotenv

### Embed Badge

![Health badge](/badges/env-dotenv/health.svg)

```
[![Health](https://phpackages.com/badges/env-dotenv/health.svg)](https://phpackages.com/packages/env-dotenv)
```

###  Alternatives

[vlucas/phpdotenv

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

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/dotenv

Registers environment variables from a .env file

3.8k226.7M2.3k](/packages/symfony-dotenv)[diarmuidie/envpopulate

Tool to interactively populate a `.env` file based on an `.env.example` file whenever Composer installs or updates.

1892.0k](/packages/diarmuidie-envpopulate)[zepgram/magento-dotenv

Simple autoloader to integrate the Symfony Dotenv component into Magento2

1371.3k](/packages/zepgram-magento-dotenv)[nystudio107/dotenvy

Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents.

326.9k](/packages/nystudio107-dotenvy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
