I am having trouble setting a new environment variable in Apache and later reading it from a Tcl script.
Here is what I have done:
1) Set new environment variable in Apache start script (apachectl) in the /path/to/apache/bin folder
export STAGING="staging"
2) Start Apache server
3) Read all environment variables and print to screen using a Tcl script:
I am not able to figure out why the new environment variable I introduced in Apache settings is not picked-up by Tcl script. Greatly appreciate any help to resolve this. Please note that the same approach works in PHP scripting.
Thanks,
Saravan
Here is what I have done:
1) Set new environment variable in Apache start script (apachectl) in the /path/to/apache/bin folder
export STAGING="staging"
2) Start Apache server
3) Read all environment variables and print to screen using a Tcl script:
Code:
#!/path/to/tclsh
#
set host $env(SERVER_NAME) <-------- this works
set webstg $env(STAGING) <-------- this doesn't!!!
puts "Content-Type: text/html\n\n"
puts "Hello world!!!<br \>"
puts "host is $host <br \>"
puts "region is $webstg <br \>"
I am not able to figure out why the new environment variable I introduced in Apache settings is not picked-up by Tcl script. Greatly appreciate any help to resolve this. Please note that the same approach works in PHP scripting.
Thanks,
Saravan