I have set environment variable in:
System (Windows 7, apache)
ENVIRONMENT = localhost.htaccess file
SetEnv ENVIRONMENT localhost
Now in my php code I get this variable with function getenv().
$environment = getenv('ENVIRONMENT');
Question:
How to get variable from system first, if it is not set, then get variable from .htaccess
SetEnvis actually the same thing as setting a system env var. The difference is that you set it with a specific value that only applies to the environment in which apache runs. You can define theENVIRONMENTvariable with any value you like, as long as apache is running in a different environment, it doesn't matter. So when you say "get the var from system", you seem to mean "get it from env X first, then from the apache env" which makes no sense at all