title: How to define APP_ENV within the Symfony app without using DotEnv?
body: <p>By default Symfony requires configuration to set on web server rather than within the application. In my case, setting these variables on the Server is very complicated. So, what I want is to set these variables inside the application (php or yaml) <strong>without DotEnv and web server env variables</strong>.</p>
  
  <p>These are the environment variables that I need to define: </p>
  
  <pre><code>APP_ENV 
  APP_SECRET
  DATABASE_URL
  MONGODB_URL
  MAILER_URL
  </code></pre>
  
  <p>Here is what I found except the APP_ENV that is not working in any place:</p>
  
  <pre><code>APP_ENV: ???
  APP_SECRET: config/packages/framework.yaml
  DATABASE_URL: config/packages/doctrine.yaml
  MONGODB_URL: config/packages/doctrine_mongodb.yaml
  MAILER_URL: config/packages/swiftmailer.yaml
  </code></pre>
  
  <p>Where do we define <code>APP_ENV</code> in Symfony 4?</p>