Skip to content

Latest commit

 

History

History
28 lines (24 loc) · 1.1 KB

environment-variables.md

File metadata and controls

28 lines (24 loc) · 1.1 KB
ID post_title author post_date post_excerpt layout permalink published docs_project publish_to_discourse
6133
Environment Variables
Ben Word
2015-08-30 12:45:01 -0700
doc
true
a:1:{i:0;s:2:"18";}
a:1:{i:0;s:1:"0";}

Bedrock tries to separate config from code as much as possible and environment variables are used to achieve this. The benefit is there's a single place (.env) to keep settings like database or other 3rd party credentials that isn't committed to your repository.

PHP dotenv is used to load the .env file. All variables are then available in your app by the built-in getenv, $_SERVER, or $_ENV methods.

However, we use the env library and its env function which handles simple type coercion (such as converting the string 'True' to the boolean true). We recommend you use env as well for reading environment variables.

Currently, the following env vars are required:

  • DB_USER
  • DB_NAME
  • DB_PASSWORD
  • WP_HOME
  • WP_SITEURL