Questions tagged [setenv]

154 questions
42
votes
5 answers

Questions about putenv() and setenv()

I have been thinking a little about environment variables and have a few questions/observations. putenv(char *string); This call seems fatally flawed. Because it doesn't copy the passed string you can't call it with a local and there is no…
ValenceElectron
  • 2,678
  • 6
  • 26
  • 27
35
votes
2 answers

How to use the setEnv variable in apache?

I need to set my apache environment to 'foobar' I know I need to set in in my vhost, but what should I type there and where?
baklap
  • 2,145
  • 6
  • 28
  • 41
33
votes
1 answer

How to import all the environment variables in tox

I'm using following in setenv to import the environment variable from where I run, but is there a way to import all the variables so that I don't really need to import one by one. e.g: {env:TEMPEST_CONFIG:} and {env:TEMPEST_CONFIG_DIR:} used to…
Manjunath Kumatagi
  • 361
  • 1
  • 4
  • 11
27
votes
5 answers

Tomcat 7 setenv.sh is not found

I downloaded and extracted the apache-tomcat-7.0. As per the instructions in the RUNNING.txt (%CATALINA_BASE%/RUNNING.txt), it should set the JRE_HOME in the "setenv.sh" file. Where is this file located ? Documentation said, it would be in…
Prakash Raman
  • 13,319
  • 27
  • 82
  • 132
27
votes
3 answers

How to set the environment variable in tox?

I have tox 2.9.1 $ tox --version 2.9.1 imported from /Library/Python/2.7/site-packages/tox/__init__.pyc registered plugins: tox-pyenv-1.1.0 at /Library/Python/2.7/site-packages/tox_pyenv.pyc File structure and content are as below $ tree…
Nilesh
  • 20,521
  • 16
  • 92
  • 148
22
votes
3 answers

How to use setenv() to export a variable in c++?

I need to export several variables such that they look like the following in the command line export ROS_HOSTNAME=xxx How do I use setenv() in c++ to achieve that? Thanks.
return 0
  • 4,226
  • 6
  • 47
  • 72
22
votes
2 answers

Conditional SetEnv in .htaccess?

Is it possible to set a SetEnv variable in an .htaccess file differently depending on hostname? For example, I need my .htaccess file to have the following value: SetEnv PYRO_ENV production On production boxes, and... SetEnv PYRO_ENV stage On…
Highway of Life
  • 22,803
  • 16
  • 52
  • 80
21
votes
4 answers

C++: Setenv(). Undefined identifier in Visual Studio

Look my code seems to be correct, according to all the documentation I can find online. My IDE is MS Visual Studio Xpress 4 Windows Desktop 2012, and it's compiler is throwing up the error: Error 1 error C3861: 'setenv': identifier not found…
MWP
  • 213
  • 1
  • 2
  • 5
18
votes
3 answers

setenv equivalent on mac?

I want to set an environment variable using setenv: setenv NODE_ENV localhost But setenv gives me an error saying the command is not found. Does anyone know how to perform the MAC OSX equivalent of setenv? Thanks!
user1871869
  • 3,317
  • 13
  • 56
  • 106
12
votes
2 answers

mod_rewrite rule and setenv

Is there anyway to use the value set in a SetEnv on the RewriteRule statement? Example: SetEnv MY_SCRIPT myScript.php rewriteEngine on RewriteRule ^(.*)$ %{MY_SCRIPT} [L]
H. Ferrence
  • 7,906
  • 31
  • 98
  • 161
11
votes
5 answers

Zend SetEnv in .htaccess not working

I installed Zend on my ubuntu homeserver. In my .htaccess file i have the following code: SetEnv APPLICATION_ENV development RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-s RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME}…
Arthur
  • 921
  • 3
  • 13
  • 25
10
votes
2 answers

Apache SetEnv prepends REDIRECT_ . What gives?

For an application based on Zend Framework I use apaches SetEnv in .htaccess. I use this on test, staging and production servers like so: SetEnv APPLICATION_ENVIRONMENT production On the staging server I couldn't read this env var in PHP. However…
Decent Dabbler
  • 22,532
  • 8
  • 74
  • 106
10
votes
1 answer

Why change in LD_LIBRARY_PATH at Runtime dosen't Reflect on the Executable once the Executable gets loaded

I'm trying to change the LD_LIBRARY_PATH from my C++ program. I'm able to get its value using getenv("LD_LIBRARY_PATH") and set its value using setenv() (and I know that this is working, because when I call getenv("LD_LIBRARY_PATH") again, I get the…
Thiyagarajan
  • 1,271
  • 1
  • 14
  • 19
10
votes
1 answer

Setting environment variable using .htaccess

I'm trying to set up an apache environment variable using .htaccess file in the following way: SetEnv SERVER_KEY "qwerty" After that i gracefully restart my apache web server: apachectl graceful Then i create a file called version.php in…
nmadhok
  • 1,704
  • 3
  • 16
  • 20
9
votes
3 answers

How secure is storing DB variables with SetEnv or in php.ini?

I don't like storing sitewide crypto keys and DB access information under document_root, so I was using Apache's SetEnv and php.ini files under conf.d to separate these from the codebase. The big question is, which one is better? Inside environment…
Jauzsika
  • 3,171
  • 3
  • 23
  • 32
1
2 3
10 11