0

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.

SpacedMonkey
  • 101
  • 2

1 Answers1

0

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

SpacedMonkey
  • 101
  • 2