title: Symfony 4 - Best practices / environment variables
body: <p>I've been using <code>parameters.yml</code> for years but now it's time to switch to Symfony 4 with environment variables :-)</p>
  
  <p>I have several questions about deploying this on my server. I'm using Nginx + PHP-FPM. The documentation says we can set environment variables on the <a href="https://symfony.com/doc/current/configuration/external_parameters.html#configuring-environment-variables-in-production" rel="nofollow noreferrer">Nginx config side</a>. Some other blogs advise to set environment variables on the <a href="https://ypereirareis.github.io/blog/2015/12/13/symfony-nginx-environment-variables-php-fpm/#nginx--php-fpm" rel="nofollow noreferrer">PHP-FPM pool config side</a>. But what about the console, then? How will <code>bin/console</code> know about these environment variables?</p>
  
  <p>The goal is to centralize the settings and having a single edit point. Maybe we could set them on the OS side, but what if I'm running multiple applications on the same server?</p>
  
  <p>In my use case, I have a remote server (FreeBSD or Ubuntu 16.04 for another app) delivering the production environment in <code>/var/www/myapp/prod</code> and the pre-production (with restricted access in the nginx config) in <code>/var/www/myapp/qualif</code>. They share the same environment variable keys but not the same values (different database DSN, for instance). I'm not using docker.</p>
  
  <p>What are your recommendations?</p>