PHPackages                             jord-jd/dotenv-loader - 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. jord-jd/dotenv-loader

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

jord-jd/dotenv-loader
=====================

Dotenv loader is a simple PHP library that will automatically load in a `.env` file from the root of your project into environment variables.

v4.1.0(1mo ago)446LGPL-3.0-onlyPHPPHP &gt;=5.5.9CI passing

Since Jan 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/Jord-JD/dotenv-loader)[ Packagist](https://packagist.org/packages/jord-jd/dotenv-loader)[ Docs](https://github.com/Jord-JD/dotenv-loader)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/jord-jd-dotenv-loader/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (14)Used By (0)

dotenv-loader
=============

[](#dotenv-loader)

The dotenv-loader is a simple PHP helper that automatically loads in a `.env` file from the root of your project into environment variables. It is designed for use in projects that do not already make use of a `.env` file.

Quick Start
-----------

[](#quick-start)

Simple run `composer require jord-jd/dotenv-loader` to install.

You'll then be able to create a `.env` file in your project's root directory (in the same location as your `composer.json` file). Any variables in the `.env` file can then be accessed in any way you wish, such as using PHP's built-in `getenv` function.

For an actual example of how to use `dotenv-loader`, see the [`test` directory](test/).

The loader supports both the legacy phpdotenv 2.x line on old PHP runtimes and the maintained phpdotenv 5.x line on current PHP versions. To load a specific directory explicitly, call `dotEnvLoader('/path/to/project')`.

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Recently: every ~770 days

Total

13

Last Release

30d ago

Major Versions

v1.0.4 → v2.0.02017-09-20

v2.0.3 → v3.0.02026-02-14

v3.0.0 → v4.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (10 commits)")

---

Tags

dotenvenvironmentenvironment-variablesenvironment-varsphpphplibraryenvironmentenvdotenvPHP Library.env PHP library

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jord-jd-dotenv-loader/health.svg)

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

###  Alternatives

[nystudio107/dotenvy

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

317.0k](/packages/nystudio107-dotenvy)[dotenv-org/phpdotenv-vault

Load environment variables from encrypted .env.vault files

1120.3k2](/packages/dotenv-org-phpdotenv-vault)

PHPackages © 2026

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