PHPackages                             razxc/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. [CLI &amp; Console](/categories/cli)
4. /
5. razxc/dotenv

ActiveLibrary[CLI &amp; Console](/categories/cli)

razxc/dotenv
============

Parser for env-files with bash syntax compatibility and zero-dependencies

0.1.0(3y ago)09MITPHPPHP ~7.3|~8.0

Since Aug 5Pushed 3y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

dotenv.php
==========

[](#dotenvphp)

[![Latest Stable Version](https://camo.githubusercontent.com/a545d53170bd50c68f402547167826f10d0b523508e6e7ebc4f4d9f405ceeb07/687474703a2f2f706f7365722e707567782e6f72672f72617a78632f646f74656e762f76)](https://packagist.org/packages/razxc/dotenv)[![Total Downloads](https://camo.githubusercontent.com/2f93767af60d2ceac5f816f7fb330401e61e09b1f19279961387041b759d869e/687474703a2f2f706f7365722e707567782e6f72672f72617a78632f646f74656e762f646f776e6c6f616473)](https://packagist.org/packages/razxc/dotenv)[![License](https://camo.githubusercontent.com/bf974b8685fd35128a9c6c39d08071ceb75293da5fd31d3e434e0caf2c96e5a7/687474703a2f2f706f7365722e707567782e6f72672f72617a78632f646f74656e762f6c6963656e7365)](https://packagist.org/packages/razxc/dotenv)[![PHP Version Require](https://camo.githubusercontent.com/68201c4327057f24e17e973e46334c5ac4c846f4ac816e71a68d15088a4f51c2/687474703a2f2f706f7365722e707567782e6f72672f72617a78632f646f74656e762f726571756972652f706870)](https://packagist.org/packages/razxc/dotenv)[![codecov](https://camo.githubusercontent.com/1e2b1ee29e00f5c081a63458c68f2096c0ad5cb8aab91617d038f3294d95af18/68747470733a2f2f636f6465636f762e696f2f67682f6168617269746f6e6f762f646f74656e762e7068702f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d564b435631345a4b3733)](https://codecov.io/gh/aharitonov/dotenv.php)

The PHP library provides pure dot-env parser with bash syntax support and zero-dependencies. Required PHP 7.3 or higher.

Alternatives: [symfony/dotenv](https://github.com/symfony/dotenv), [vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)

---

Feature
-------

[](#feature)

- "export" notation
- default values
- multiline values
- variable resolving

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

[](#installation)

```
composer require razxc/dotenv
```

Example
-------

[](#example)

```
$array = DotenvParser::fromFile('path/to/.env', $_ENV);

foreach ($array as $name => $value) {
    putenv("$name=$value");
}

foreach ($array as $name => $value) {
    print $name . ' => ' . getenv($name) . PHP_EOL;
}
```

TODO
----

[](#todo)

- command resolving

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

Unknown

Total

1

Last Release

1381d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a042b2223ba53b9a56bfb2f49505f46466cfa9ea7124ff7cd10c041c354406df?d=identicon)[razxc](/maintainers/razxc)

---

Top Contributors

[![aharitonov](https://avatars.githubusercontent.com/u/4365589?v=4)](https://github.com/aharitonov "aharitonov (6 commits)")

---

Tags

parsershellenvironmentenvdotenvbash

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24032.0k2](/packages/alecrabbit-php-console-spinner)[stepanenko3/nova-command-runner

Laravel Nova tool for running Artisan and bash(shell) commands.

36983.0k](/packages/stepanenko3-nova-command-runner)[merlinthemagic/mts

PHP Automation Tools

1144.5k](/packages/merlinthemagic-mts)[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)[tamer-dev/laravel-env-cli

laravel commands to work with .env file in cli

126.5k](/packages/tamer-dev-laravel-env-cli)

PHPackages © 2026

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