I've been trying to set an environment variable in my Apache + PHP-FPM setup, but I'm a bit overwhelmed with the documentation and confused about the correct approach. I hope someone here can help me out.
To give you some context, I'm working on a web application that requires certain configuration variables to be set globally across the application. I figured using environment variables would be a good fit for this, as it allows me to easily configure different values for development, staging, and production environments.
I'm using Apache as my web server and PHP-FPM as the FastCGI process manager for PHP. I've already installed and configured them properly. Now, I'm looking for guidance on how to set up environment variables specifically for this setup.
I've read through the Apache documentation and different online resources, but I'm still unsure about the best approach. Some sources suggest using the `SetEnv` directive in the Apache Virtual Host configuration, while others recommend editing the PHP-FPM pool configuration.
Which one is the right way to go? Should I use both? And how exactly do I set the environment variables using these methods? It would be great if someone could provide me with a step-by-step guide or point me to a resource that explains it clearly.
Thanks in advance for your help!