Closed
Description
After reading the Configuration / Environment Variables docs multiple times, I realized the reason it wasn't making sense was that there was no example of using the $_ENV
superglobal array in PHP to actually read data from the .env
configuration. In fact, the only mention of it was this sentence about halfway through the document:
The .env file is read and parsed on every request and its env vars are added to the $_ENV & $_SERVER PHP variables.
https://symfony.com/doc/5.4/configuration.html
When I found that, it all made perfect sense to me. There should be an obvious example showing how the .env
file is intended to be used in PHP app code so that readers don't mistakenly scour the page looking for an API.