I know that it is possible to pass an environment variable to another program running in the same process (i.e. a driver manager, iODBC, in my case) using the putenv method. However, I am trying to send a custom http header variable through to my driver manager without the script being aware of it. Therefore, I'd like to be able to access a variable from the array HTTP_SERVER_VARS from the driver manager, without having to use putenv. Is this possible? With globals on, I can do a
$http_host = getenv("HTTP_HOST");
putenv("HTTP_HOST = $http_host");
otherwise, doing a getenv("HTTP_HOST") from the driver manager's C-code yields (null). Therefore, it seems I have to use putenv. But this seems a little ridiculous, no?
Regular environment variables work fine by the way (i.e. DISPLAY, HOSTNAME and such) without a putenv. It is only the ones that are scoped within php, i.e. HTTP_SERVER_VARS or those in GLOBALS that create problems. Any help would be greatly appreciated.