Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D0C1A187BB for ; Fri, 18 Mar 2016 15:09:49 +0000 (UTC) Received: (qmail 15543 invoked by uid 500); 18 Mar 2016 15:09:45 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 15514 invoked by uid 500); 18 Mar 2016 15:09:45 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 15504 invoked by uid 99); 18 Mar 2016 15:09:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Mar 2016 15:09:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 2A8351A10D7 for ; Fri, 18 Mar 2016 15:09:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.219 X-Spam-Level: * X-Spam-Status: No, score=1.219 tagged_above=-999 required=6.31 tests=[FREEMAIL_REPLY=1, RCVD_IN_DNSWL_LOW=-0.7, SPF_FAIL=0.919] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id HgozZYLSPnrH for ; Fri, 18 Mar 2016 15:09:43 +0000 (UTC) Received: from mailout02.webmailer.hosteurope.de (mailout02.webmailer.hosteurope.de [80.237.138.58]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id CF7525F23E for ; Fri, 18 Mar 2016 15:09:42 +0000 (UTC) Received: from server06.webmailer.hosteurope.de ([10.9.0.185])AUTHED by mailout.webmailer.hosteurope.de (mailout02.webmailer.hosteurope.de) running EXperimental Internet Mailer with esmtps (TLSv1:AES256-SHA:256) id 1agw1w-0005RV-4a for users@httpd.apache.org; Fri, 18 Mar 2016 16:09:36 +0100 Received: from nobody by server06.webmailer.hosteurope.de with local (Exim 4.72) (envelope-from ) id 1agw1w-0007ba-0U for users@httpd.apache.org; Fri, 18 Mar 2016 16:09:36 +0100 X-Squirrel-UserHash: EhVcX1tHQwpbRxwDDRdZ X-Squirrel-FromHash: V1VdXl8QQwNdWg8WWFFYCQtac1VdU11eDBAWCg0PWUI= Message-ID: <480abae11c204aeed3a93508dfec360a-EhVcX1tHQwpbRxwDDRdZZ1dfaANWUkNeXENbCl41W0BYVFJZWV58A1UDC1VbQUQIC19cFFJdXgheVSVQBl1XDQpBR21eXlxIW1RbD1ha-webmailer1@server06.webmailer.hosteurope.de> In-Reply-To: References: <1269703283.602514.1458243513719.JavaMail.ngmail@webmail12.arcor-online.net> Date: Fri, 18 Mar 2016 16:09:35 +0100 From: obsd@arcor.de To: users@httpd.apache.org User-Agent: Host Europe Webmailer/1.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Status: not scanned, license restriction X-KLMS-AntiPhishing: not scanned, license restriction X-KLMS-AntiVirus: Kaspersky Security 8.0 for Linux Mail Server, version 8.0.1.705, bases: 2016/03/18 05:50:00 #7271630; khse: 2014-01-23 rollback X-KLMS-AntiVirus-Status: Clean, skipped X-HE-Access: Yes X-bounce-key: webpack.hosteurope.de;obsd@arcor.de;1458313776;a4aaf76e; Subject: Re: [users@httpd] Environment variable set by "apr_env_set()" not accesible by C function "getenv()" within CGI program On Thu, Mar 17, 2016 at 8:47 PM, Eric Covener wrote: > On Thu, Mar 17, 2016 at 3:38 PM, wrote: >> Hi, >> >> I have an Apache modul where I set an environment variable: >> >> apr_env_set("FOO", "BAR", ...); >> >> This variable is accesible by PHP: >> >> > print(getenv("FOO")); // --> BAR >> ?> >> >> but not by a simple CGI program written in C: >> >> #include >> #include > > 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@gmail.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org Hi, many thanks. apr_table_setn(r->subprocess_env, "FOO", "BAR") works perfectly. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org