You should never store sensitive credentials in your code. Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments, such as database credentials or credentials for 3rd party services, should be extracted from the code into environment variables. Basically, a .env file is an easy way to load custom configuration variables that your application needs without having to modify .htaccess files or Apache/nginx virtual hosts. This means you won't have to edit any files outside the project, and all the environment variables are always set no matter how you run your project, Apache, Nginx, CLI, and even PHP's built-in webserver. It's WAY easier than all the other ways you know of to set environment variables, and you're going to love it!

Features

  • No editing virtual hosts in Apache or Nginx
  • No adding php_value flags to .htaccess files
  • Easy portability and sharing of required ENV values
  • Compatible with PHP's built-in web server and CLI runner
  • PHP dotenv is a PHP version of the original Ruby dotenv
  • Installation is super-easy via Composer

Project Samples

Project Activity

See All Activity >

License

BSD License

Follow PHP dotenv

PHP dotenv Web Site

Other Useful Business Software
PRTG Catches Network Issues Before They Cause Downtime Icon
PRTG Catches Network Issues Before They Cause Downtime

Threshold-based alerts flag problems early, so your team can act before users notice, not after.

Reactive troubleshooting usually means hearing about a problem from frustrated users, not your monitoring tool. PRTG sets threshold-based alerts across devices, servers and applications, notifying your team by email, SMS or push the moment a metric crosses a set limit. That means catching a failing disk or overloaded server before it becomes an outage and getting time back from firefighting. Start a free trial and set your first alerts today.
Download 30-Day Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of PHP dotenv!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Security Software, PHP Source Code Analysis Tool

Registered

2021-05-20