Environment variables: Best way to save configuration variables in a PHP application
Introduction
Almost all PHP application use configuration variables to store configurations; like database credentials, memcache details, 3rd part api details and many others.
According to The Twelve-factor App all these config should Never be committed to SCM and developers should keep it separate from codebase. Further they suggest that config should be stored in environment variables (env vars or env).