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

Abandoned → [michel/dotenv](/?search=michel%2Fdotenv)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

phpdevcommunity/php-dotenv
==========================

PHP-DotEnv is a lightweight PHP library designed to simplify the management of environment variables in your PHP applications.

3.0.1(1y ago)7617.6k↑88.9%252MITPHPPHP &gt;=7.4

Since Jan 9Pushed 5mo ago5 watchersCompare

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

READMEChangelog (9)Dependencies (1)Versions (12)Used By (2)

> ⚠️ **Abandoned package**
>
> This package is abandoned and no longer maintained.
> The author suggests using **[michel/dotenv](https://github.com/michelphp/dotenv)** instead.

PHP-DotEnv
==========

[](#php-dotenv)

PHP-DotEnv is a lightweight and robust PHP library designed to simplify the management of environment variables in your PHP applications. It parses a `.env` file and loads the variables into `getenv()`, `$_ENV`, and `$_SERVER`.

It comes with a powerful processor system that automatically converts values (booleans, nulls, numbers) and allows you to define your own custom processors for specific needs.

---

English Documentation
---------------------

[](#english-documentation)

### Installation

[](#installation)

Requires PHP 7.4 or higher.

Install via Composer:

```
composer require phpdevcommunity/php-dotenv
```

### Basic Usage

[](#basic-usage)

1. **Create a `.env` file** in your project root:

    ```
    APP_ENV=dev
    DATABASE_URL="mysql:host=localhost;dbname=test"
    DEBUG=true
    CACHE_TTL=3600
    API_KEY=null
    # This is a comment
    ```
2. **Load the variables** in your PHP entry point (e.g., `index.php`):

    ```
