Reputation: 504
I am a bit confused by the following sentence in Laravel 5
Documentation :
Any variable in your .env file can be overridden by external environment variables such as server-level or system-level environment variables.
It looks like what I want to do, i.e. setting some of my .env variables from server-level environment variables, but I can't find any reference on how to do it.
It seems that there are some security concerns behind such a configuration, but the following stackoverflow answer does not comment this precise sentence.
I also tend to think that if references to environment variables are used in the .env
file, it is precisely to remove the confidential information, and as such I don't see anymore the security concerns.
My conclusion is that I misunderstood the sentence, but I'd be very happy to understand why, or, if by chance it happens to be possible, know how to do that. Thanks.
Upvotes: 6
Views: 3818
Reputation: 8668
I was curious about this as well. Here's your answer:
System Level Env Variables:
These are set on the actual operating system themselves.
For example, in Windows, system level variables can be configured in:
Not sure where env variables are stored in Linux unfortunately.
Server Level Env Variables:
These are set on the host server, for example in Apache, server level env variables can be configured via the file /etc/apache2/envvars
https://httpd.apache.org/docs/2.4/mod/mod_env.html#setenv
On Windows IIS, they can be configured via the FastCGI module described here:
If hyperlink changes:
.env
Variables:
Of course, these are environment variables that you define inside of a .env
file in the root of your Laravel application.
Upvotes: 5