PHPackages                             originphp/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. originphp/dotenv

ActiveLibrary

originphp/dotenv
================

OriginPHP DotEnv

2.0.0(5y ago)28.4k3MITPHPPHP &gt;=7.3.0CI failing

Since May 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/originphp/dotenv)[ Packagist](https://packagist.org/packages/originphp/dotenv)[ Docs](https://www.originphp.com)[ RSS](/packages/originphp-dotenv/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (6)Used By (3)

DotEnv
======

[](#dotenv)

[![license](https://camo.githubusercontent.com/6fdb99389fe9d9e8a5c197002a191ace7c8b12a2020c0fa5756cf17aa08a4966/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874477265656e2e737667)](https://camo.githubusercontent.com/6fdb99389fe9d9e8a5c197002a191ace7c8b12a2020c0fa5756cf17aa08a4966/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874477265656e2e737667)[![build](https://github.com/originphp/dotenv/workflows/CI/badge.svg)](https://github.com/originphp/dotenv/actions)[![coverage](https://camo.githubusercontent.com/37796b0bc82bf3534f104ee964392ba47cbc5e31198e5e37564b5ed20fd0c320/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f726967696e7068702f646f74656e762f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/originphp/dotenv?branch=master)

A dotenv parser.

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

[](#installation)

To install this package

```
$ composer require originphp/dotenv

```

Then in your application bootstrap

```
use Origin\DotEnv\DotEnv;
(new DotEnv())->load(__DIR__);
```

Here is an example of a dotenv file.

```
GMAIL_USERNAME=foo@gmail.com
GMAIL_PASSWORD=secret

```

You can also add `export` in front of each line so you can source the file with bash.

```
export GMAIL_USERNAME=foo@gmail.com
export GMAIL_PASSWORD=secret

```

If you want to use a custom name

```
use Origin\DotEnv\DotEnv;
(new DotEnv())->load(__DIR__,'.env-local');
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

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 ~57 days

Total

5

Last Release

1961d ago

Major Versions

1.0.3 → 2.0.02021-01-04

PHP version history (3 changes)1.0.0PHP ^7.2.0

1.0.3PHP &gt;=7.2.0

2.0.0PHP &gt;=7.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e8a821333d9c7b7bc2ad3d164d142f65cd3912dea78033d31f76b0f19ba8a0c?d=identicon)[originphp](/maintainers/originphp)

---

Top Contributors

[![jamielsharief](https://avatars.githubusercontent.com/u/20553479?v=4)](https://github.com/jamielsharief "jamielsharief (13 commits)")

---

Tags

envdotenvoriginPHP

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/originphp-dotenv/health.svg)](https://phpackages.com/packages/originphp-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)[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)[m1/env

Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.

6412.0M21](/packages/m1-env)[sroze/companienv

Companion for .env files

245418.8k1](/packages/sroze-companienv)[johnathanmiller/secure-env-php

Encrypt environment files for production use.

6054.3k2](/packages/johnathanmiller-secure-env-php)

PHPackages © 2026

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