简体   繁体   中英

How do I set environment variables in WAMP

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

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

请注意,使用putenv()时,$ _ENV中将无法使用该值,您必须使用getenv()来获取该值。

根据您需要完成的内容,您可能需要查看使用putenv()或者如果要更改apache环境变量apache_setenv()

也许他们出现在$_SERVER

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM