|
From: | Zheng, Wendy |
Subject: | Re: [Cgicc-help] How to get system environment variable |
Date: | Mon, 31 Aug 2015 02:03:43 +0000 |
Thank you for replying. The issue is fixed by using PASSENV in the apache configuration. Thanks, Wendy From: Clay Dowling [mailto:address@hidden
If getenv isn't providing it, then MY_FAMILY isn't defined in your program's runtime environment. getenv from libc is the definitive answer on whether or not something is in the environment. On Fri, Aug 28, 2015 at 2:29 AM, Zheng, Wendy <address@hidden> wrote: Hi expertise, I’m trying to read system environment variable from my cgi application. I try following methods, but it doesn’t work. Does anyone know how to do it? 1. char *family = getenv ("MY_FAMILY"); if (family != NULL) { SERVICE_DEBUG(family); } else { SERVICE_DEBUG("Family is null"); } 2. CgiInput input; string family = input.getenv("MY_FAMILY"); SERVICE_ERROR("MY_FAMILY=" << family); From the document of CgiEnvironment
http://www.gnu.org/software/cgicc/doc/classcgicc_1_1CgiEnvironment.html , it looks like we should be able to get the system environment variable. But I can’t find a way to do it. Thanks, Wendy
|
[Prev in Thread] | Current Thread | [Next in Thread] |