Re: Environment variable set by "apr_env_set()" not accesible by C function "getenv()" within CGI program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 17, 2016 at 8:47 PM, Eric Covener wrote:
> On Thu, Mar 17, 2016 at 3:38 PM,  <obsd@xxxxxxxx> wrote:
>> Hi,
>>
>> I have an Apache modul where I set an environment variable:
>>
>> apr_env_set("FOO", "BAR", ...);
>>
>> This variable is accesible by PHP:
>>
>> <?php
>>     print(getenv("FOO")); // --> BAR
>> ?>
>>
>> but not by a simple CGI program written in C:
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>
> The environment used for a CGI is not the environment of httpd.  You
> can modify it by adding entries to r->subprocess_env.
>
> Only some very specific vars are copied from httpds environment to the
> CGI, + the subprocess_env entries.
> --
> Eric Covener
> covener@xxxxxxxxx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

Hi,

many thanks.

apr_table_setn(r->subprocess_env, "FOO", "BAR")

works perfectly.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux