Custom Environment Variables in PHP Custom Environment Variables in PHP php php

Custom Environment Variables in PHP


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 php functions 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.