PHPackages                             peachpear/phpdotenv - 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. peachpear/phpdotenv

ActiveLibrary

peachpear/phpdotenv
===================

phpdotenv is a environment config classs

1.0.1(4y ago)051MPL-2.0PHPPHP &gt;=5.1.0

Since May 9Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (1)

phpdotenv
=========

[](#phpdotenv)

phpdotenv is a php environment config classs

Usage
-----

[](#usage)

The `.env` file, eg:

```
name = app

[app]
debug = "true"
trace = "false"

[database]
hostname = 127.0.0.1
database = test
username = abc
password = 123456
hostport = 3306

```

The file `index.php`, eg:

```
Dotenv\Dotenv::load(__DIR__ . "/.env");

```

The config file, eg:

```
define("APP_NAME", Dotenv\Dotenv::get("name"));

define("APP_DEBUG", Dotenv\Dotenv::get("app.debug"));
define("APP_TRACE", Dotenv\Dotenv::get("app.trace"));

$database_config = [
    "hostname" => Dotenv\Dotenv::get("database.hostname"),
    "database" => Dotenv\Dotenv::get("database.database"),
    "username" => Dotenv\Dotenv::get("database.username"),
    "password" => Dotenv\Dotenv::get("database.password"),
    "hostport" => Dotenv\Dotenv::get("database.hostport"),
];

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

1471d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/819a98d6510f153619bca993382ab14b56a861bdb371e60339aa9b98b9b20ace?d=identicon)[iBaiYang](/maintainers/iBaiYang)

---

Top Contributors

[![iBaiYang](https://avatars.githubusercontent.com/u/13947594?v=4)](https://github.com/iBaiYang "iBaiYang (1 commits)")

---

Tags

dotenvphpdotenvpeachpear

### Embed Badge

![Health badge](/badges/peachpear-phpdotenv/health.svg)

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

###  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)[josegonzalez/dotenv

dotenv file parsing for PHP

2799.8M137](/packages/josegonzalez-dotenv)[sixlive/dotenv-editor

A tool to edit phpdotenv files

761.5M11](/packages/sixlive-dotenv-editor)[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)

PHPackages © 2026

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