I've been using parameters.yml
for years but now it's time to switch to Symfony 4 with environment variables :-)
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 Nginx config side. Some other blogs advise to set environment variables on the PHP-FPM pool config side. But what about the console, then? How will bin/console
know about these environment variables?
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?
In my use case, I have a remote server (FreeBSD or Ubuntu 16.04 for another app) delivering the production environment in /var/www/myapp/prod
and the pre-production (with restricted access in the nginx config) in /var/www/myapp/qualif
. They share the same environment variable keys but not the same values (different database DSN, for instance). I'm not using docker.
What are your recommendations?