Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a C CGI that is invoked by Apache, both running as SYSTEM.

The CGI relies on the setting of WINDIR and TEMPLATES environment variables. It gets the value of WINDIR without any problems but getenv("TEMPLATES") always returns NULL.

TEMPLATES is a system variable.

Another post Win Service running under LocalService account cannot access environment variables suggested rebooting, I tried this to no avail, and to make sure HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\ has the needed environment variable, it does.

Thanks.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Fixed this by adding a PassEnv directive to my Directory context:

PassEnv TEMPLATES

Documentation here http://httpd.apache.org/docs/2.2/mod/mod_env.html#passenv

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.