views:

196

answers:

4

Hello, I am trying to get an environment variable to show up in $_ENV in my codeigniter app. How do i do this?

A: 

Depending on exactly what you need to accomplish you probably need to look at using putenv() or if you want to change an apache environment variable, apache_setenv().

Noah Goodrich
A: 

Perhaps they show up in $_SERVER?

Ignas R
A: 

Please note that when using putenv() the value will not be available in $_ENV, and you have to use getenv() to obtain the value.

Hanse
A: 

You can set an environment variable in a few different ways. Some (not all?) are:

  • put them in .htaccess files
  • specify on the command line
  • specify them in your Apache config file like this:

Apache config:

SetEnv env_var_name env_var_value
Chris Williams