Questions tagged [environment-variables]

Environment variables are configuration options that can be set in a shell or other similar environments. All programs started from within the shell can read them and configure themselves.

Environment variables are key-value-pair configuration options like KEY=valueor FOO=bar. Environment variables allow you to configure a program before it gets executed and without the need to store these variables in proprietary configuration files.

They are present on all POSIX systems (Unix, Linux, BSD, Mac OS, DOS, Windows, ...). Environment variables can be set by any shell and read by nearly any programming language.

Some programming languages allow you to set Environment variables, but they only persist within the current process. You can't set them to be visible by the calling shell. So they are not useful for inter-process communication.

410 questions
0
votes
1 answer

C CGI invoked by apache 2.2 on Windows 7 cannot read environment variable

I have a C CGI that is invoked by Apache, both running as SYSTEM. The CGI relies on the setting of WINDIR and TEMPLATES environment variables. It gets the value of WINDIR without any problems but getenv("TEMPLATES") always returns NULL. TEMPLATES…
SpacedMonkey
  • 101
  • 2
0
votes
2 answers

calling an environment variable in a ps-watcher config file

I am trying to use ps-watcher to monitor my system and make sure a given number of worker threads are working on a task. If I hard code the number of workers into the config file for ps-watcher, it works great. However I would like the number of…
JD Long
  • 445
  • 1
  • 4
  • 13
0
votes
2 answers

Write environmental variable on client machines, based on AD information

I want to alter the logon.bat script for our AD users (Windows XP/vista/7 machines and a few servers), so that it writes an environmental variable upon login based on some AD information, like "what group is the user in". Basically: SET…
Ralf
  • 1
0
votes
2 answers

Windows restart after Env. Var. change?

When do I need to do a restart for my server to use a variables new value, or no restart necessary? Is it OS version dependent?
user8160
  • 329
  • 5
  • 13
0
votes
3 answers

Environment for specific application

Is it possible to specify environment variables for a given application only? So that environment variables are set automatically when the application starts ('VAR=VALUE myapp' is not what I want). The actual problem is, I want wine to always start…
VladV
  • 163
  • 1
  • 6
0
votes
1 answer

how to set environment variable in Solaris (in .profile)

how do I set an environment variable in my .profile file that takes into account if the variable exists and appends to it? To explain: I want to do export ANT_OPTS=-Dparam=value but if the ANT_OPTS already exists I want to append to it. I want to…
user12345
0
votes
2 answers

Windows 7 Custom Environment Variable Disappears

I am trying to set a custom environment variable in Windows 7, which needs to be done programmatically as it must be set on multiple computers. I have been testing one a single machine, but When I create it programmatically, it exists for that…
Ben
  • 1,137
  • 9
  • 26
  • 44
0
votes
2 answers

How to set the ery globap $PATH in Ubuntu 10.04 Server?

On Ubuntu 10.04 Server, where can I adjust the essential $PATH environment variable value which will all applications and all users see?
Ivan
  • 3,398
  • 19
  • 50
  • 71
0
votes
1 answer

Is there some trick to replace rebooting in windows?

I've added the directory of php.exe to PATH variable,and it's available for administrator,but it's not available for user daemon. But it's available after rebooting,why is rebooting necessary?Is there some trick to replace rebooting?
vps
  • 1,227
  • 3
  • 13
  • 14
0
votes
1 answer

Windows Directory not reporting correctly in Server 2k3?

We have an application that depends on the .NET framework and performs a check at startup to see if the framework is installed. On our client machines, this works fine, but on our servers that run Windows Server 2k3, the check fails. When we look…
0
votes
1 answer

Setting pythonpath for Trac running as fast-cgi

I have a trac install set up using fast-cgi on a server. I'm trying to install the bitten extension to it so I can do continuous integration - however the environment on which trac is running for some reason doesn't have ~/lib/pythonX.X/ in its…
Zxaos
  • 496
  • 3
  • 6
  • 18
0
votes
1 answer

host not found in "$server_listen_port" of the "listen" directive

With the following nginx config excerpt: map $server_name $server_listen_port { default 443; localhost. 80; localhost 80; } server { server_name "${ENVIRONMENT_SERVER_NAME}."; listen $server_listen_port http2 reuseport; #…
0
votes
0 answers

Docker compose scale with different environment variable value

I want to achieve scaling of the container based on the array of values (like a matrix set of values used for creating containers). I can't do scaling with a single container in docker compose file: services: runner: image:…
0
votes
0 answers

I cannot get environment variable from apache

On a Centos 8, I added a SetEnv into my VirtualHost conf: Alias /static/ /opt/industrialisation/xxxx/xxxx/xxxx/ Require all granted
Pozinux
  • 163
  • 8
0
votes
1 answer

PHP exec(iptables --help) works but exec(iptables --command) doesn't work

In PHP 7.3.33 and Apache 2.4 I want to run iptables from PHP (web server enviroment) in order to block/unblock IPs, from command line, this works fine: /usr/sbin/iptables --insert INPUT --source example.com --jump DROP But if I try from PHP with…