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

You Might Also Like
La version gratuite d'Auth0 s'enrichit ! Icon
La version gratuite d'Auth0 s'enrichit !

Gratuit pour 25 000 utilisateurs avec intégration Okta illimitée : concentrez-vous sur le développement de vos applications.

Vous l'avez demandé, nous l'avons fait ! Les versions gratuite et payante d'Auth0 incluent des options qui vous permettent de développer, déployer et faire évoluer vos applications en toute sécurité. Utilisez Auth0 dès maintenant pour découvrir tous ses avantages.
Essayez Auth0 gratuitement
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