setenv

Strange behaviour for setenv & getenv in OS X Yosemite

非 Y 不嫁゛ 提交于 2019-12-02 04:09:54
When I set an environment variable launchctl setenv FOO test I can fetch the value by launchctl getenv FOO which returns me 'test', but a simple echo $FOO doesn't substitute, the result is empty. In same terminal as well as in new terminal. Background: Yosemite 10.10 doesn't support /etc/launchd.conf anymore for system wide settings, so Setting environment variables via launchd.conf no longer works in OS X Yosemite/El Capitan/macOS Sierra? looks pretty promising, but I need the access to the env vars via $VARNAME , which doesn't work in my case. ursa As I wrote in section Issues / problems

Apache SetEnv prepends REDIRECT_ . What gives?

喜欢而已 提交于 2019-12-01 14:59:16
问题 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 when I did a var_dump( $_ENV ) in php I got the value but the key was prepended with REDIRECT_ becoming REDIRECT_APPLICATION_ENVIRONMENT Can anybody explain why this is happening, and how I can prevent this? 回答1: I'm guessing you have mod_rewrite

Can I concatenate environment variables in apache config?

筅森魡賤 提交于 2019-12-01 10:41:39
I have two environment variables in apache config, I want to concatenate them into one new environment variable. Is this possible? I realise this doesn't work, but it demonstrates the sort of thing I'm after: SetEnv one foo SetEnv two bar SetEnv three one+two ...and then 'three' would have the value "foobar" Use a mod_rewrite regular expression with two wildcard backreferences to access the environment variables and concatenate the strings: #This will be true for any user agent RewriteCond %{HTTP_USER_AGENT} ^.* #Replace / with / and set the new environment variable RewriteRule /(%{ENV:one})*(

Can I concatenate environment variables in apache config?

主宰稳场 提交于 2019-12-01 07:28:10
问题 I have two environment variables in apache config, I want to concatenate them into one new environment variable. Is this possible? I realise this doesn't work, but it demonstrates the sort of thing I'm after: SetEnv one foo SetEnv two bar SetEnv three one+two ...and then 'three' would have the value "foobar" 回答1: Use a mod_rewrite regular expression with two wildcard backreferences to access the environment variables and concatenate the strings: #This will be true for any user agent

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

南笙酒味 提交于 2019-11-30 19:17:36
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 variables under apache vhost files ( SetEnv SITEKEY 'oinkoink!' ) or inside conf.d/xxx.ini files ( db_pass="oink?" )? Maybe something else? PROS n CONS: SetEnv: +Stored outside DOCUMENT_ROOT +Only the given vhost has access -Visible with PHPINFO() - Hacker needs direct access/upload exploit to files get_cfg_var: +Stored outside DOCUMENT_ROOT +Not

Java: load a library that depends on other libs

…衆ロ難τιáo~ 提交于 2019-11-30 10:26:55
I want to load my own native libraries in my java application. Those native libraries depend upon third-party libraries (which may or may not be present when my application is installed on the client computer). Inside my java application, I ask the user to specify the location of dependent libs. Once I have this information, I am using it to update the "LD_LIBRARY_PATH" environment variable using JNI code. The following is the code snippet that I am using to change the "LD_LIBRARY_PATH" environment variable. Java code public static final int setEnv(String key, String value) { if (key == null)

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

本秂侑毒 提交于 2019-11-30 03:26:30
问题 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 variables under apache vhost files ( SetEnv SITEKEY 'oinkoink!' ) or inside conf.d/xxx.ini files ( db_pass="oink?" )? Maybe something else? PROS n CONS: SetEnv: +Stored outside DOCUMENT_ROOT +Only the given vhost has access -Visible with PHPINFO()

How to find Windows SDK's SetEnv.cmd / SetEnv.cmd Does not work correctly

只愿长相守 提交于 2019-11-28 12:25:44
We have a Team City Build Server running and want to compile a Visual C++ project. So far this would be easy, since I've setup our Windows Build Agent with the Windows SDK, but we don't have a solution / project file. The project files are instead created with CMake. CMake seems to be a little bit dumb (can't generate Solution when Visual Studio is not installed), but with some tricks, I could get it to do it. The solution can then be built with MSBuild. And here comes the problem. For this to work automatically, I need to call the Windows SDK's SetEnv.cmd. And I can't seem to find it

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

帅比萌擦擦* 提交于 2019-11-28 10:06:09
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 e:\users\owner\documents\visual studio 2012\projects\project1\project1\source1.cpp 18 1 Project1 . Help me!!! #include <windows.h> #include <sstream> #include <ostream> #include <cstdlib> #include <iostream> #include <stdlib.h> using namespace std; int howManyInClass = 0; int main(){ long checklength = sizeof(getenv("classSize"))/sizeof(*getenv("classSize"

How to use the setEnv variable in apache?

耗尽温柔 提交于 2019-11-27 14:23:51
问题 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? 回答1: SetEnv sets a particular variable to some value, so you need something like SetEnv varname varvalue If this is for a specific virtual host, and you have access to the Apache configuration files, this would go inside the <VirtualHost> directive for that virtual host. If you don't have control of the config files, you'll need to put it in a .htaccess file. But for