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

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

linna/dotenv
============

Linna .env tool

v1.1.1(4y ago)34212[1 PRs](https://github.com/linna/dotenv/pulls)1MITPHPPHP &gt;=7.2

Since Nov 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/linna/dotenv)[ Packagist](https://packagist.org/packages/linna/dotenv)[ Docs](https://github.com/linna/dotenv)[ RSS](/packages/linna-dotenv/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (7)Used By (1)

 [![Linna Logo](logo-linna-96.png)](#)

 [![Linna dotenv Logo](logo-dotenv.png)](#)

[![Tests](https://github.com/linna/dotenv/actions/workflows/tests.yml/badge.svg)](https://github.com/linna/dotenv/actions/workflows/tests.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2f30875c51cf9cf09eaefc2be27e43bfb742c4d83cd06b6ef0c76ff5ce00e4b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696e6e612f646f74656e762f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/linna/dotenv/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/8acf99aae0e7893199b84e036784390eb0198d28ea2a57171049e8deed377b14/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c696e6e612f646f74656e762f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/linna/dotenv/?branch=master)[![StyleCI](https://camo.githubusercontent.com/f27b0aee07fd2eece9040d5684be5954d270d276e9505578b58bb2b8947d745d/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3134353432383536352f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://github.styleci.io/repos/145428565)[![PDS Skeleton](https://camo.githubusercontent.com/3c7140ee36205075ed977142f25c29eb1fb7809e9b86a865461fc21776ad1665/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c6174)](https://github.com/php-pds/skeleton)[![PHP 7.2](https://camo.githubusercontent.com/cfd628dc653e38ca05e99444ae5189ffdbfc80c23e828332633fc9f866763d93/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e322d3838393242462e737667)](http://php.net)

About
=====

[](#about)

This package provide a way to load .env files values as environement variable, it was insiperd by [nodejs counterpart](https://github.com/motdotla/dotenv).

Requirements
------------

[](#requirements)

This package require php 7.2

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

[](#installation)

With composer:

```
composer require linna/dotenv

```

Usage
-----

[](#usage)

.env.test file as example

```
APP=linna
APP_ENV=production
USER=user.name@linna.tools
FOO=foo
BAR=bar
BAZ=baz

```

php code for get above values

```
$env = new Linna\DotEnv\DotEnv();
$env->load('.env.test');

$app = $env->get('APP');
$app_env = $env->get('APP_ENV');

//string 'linna' (length=5)
var_dump($app);

//string 'production' (length=10)
var_dump($app_env);
```

environment information in phpinfo()

```
phpinfo(INFO_ENVIRONMENT);
```

[![phpinfo(INFO_ENVIRONMENT)](dotenv-screen.png)](dotenv-screen.png)

Notes
-----

[](#notes)

DotEnv class use php function [getenv](http://php.net/manual/en/function.getenv.php) and [putenv](http://php.net/manual/en/function.putenv.php) then key and values will not be loaded in `$_ENV` superglobal.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

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

Total

4

Last Release

1544d ago

PHP version history (3 changes)v1.0.0PHP ^7.1

v1.1.0PHP ^7.2

v1.1.1PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b0180939371d6dbe2ab2d18829614d90a995b833d6bb7f503a11766f8d130f0?d=identicon)[s3b4stian](/maintainers/s3b4stian)

---

Top Contributors

[![s3b4stian](https://avatars.githubusercontent.com/u/11441761?v=4)](https://github.com/s3b4stian "s3b4stian (23 commits)")

---

Tags

dotenvenvphpphpenv

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[allysonsilva/laravel-multienv

This package allows you to use multiple .envs in multitenant environment

537.2k](/packages/allysonsilva-laravel-multienv)

PHPackages © 2026

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