Is there a way to set a custom variable such as environment_name
in my apache vhost file that can be read via $_ENV
or ini_get("environment_name")
?
views:
23answers:
1
+5
A:
I know if you
SetEnv MY_VAR 1
in your .htaccess file that you'll be able to
echo $_SERVER['MY_VAR']
in your PHP script and/or program. If you can do it in .htacces, you can do it in your vhost configuration.
There's also method to set your php ini values.
I'm not sure about a way to populate $ENV, or is SetEnv will do it. It's worth investigating a var_dump($ENV) with the above.
Alan Storm
2010-08-14 01:35:42
That will do nicely.. :D
Ian
2010-08-14 01:41:33
@Ian Note that `$_SERVER` and `$_ENV` are completely different.
NullUserException
2010-08-14 01:43:51
Yeah, I really didn't care where I pull it from, as long as it's easily accessible. :)
Ian
2010-08-14 02:54:12