Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set environment variables in apache xampp ?

I would like to add some environment variables in apache xampp in windows. I already tried the following : adding this in httpd.conf

SetEnv ENVIRONMENT "setting"

or, run this script

putenv("ENVIRONMENT='setting'");

but that doesn't seem to work when I echo phpinfo(), there isn't ENVIRONMENT variable in the environment section

like image 594
otong Avatar asked Jun 01 '16 13:06

otong


1 Answers

I know this is an old post and the OP already may has solved this by himself but for others:

SetEnv ENVIRONMENT setting

This would be the correct Syntax inside of the httpd.conf file. Also, this code should be put at the end of the file.

After saving httpd.conf the apache server needs to be restarted. Otherwise the environment variable will not be set in "this" apache session!

Sincerely, Kami Yang

like image 149
Kami Yang Avatar answered Oct 23 '22 00:10

Kami Yang