As you may know, in order to pass environment variables to a CGI script, you have to set them explicitly in your httpd.conf. I spent a long time recently banging my head on a similar problem. Can you show us your settings in httpd.conf for the relevant directory(ies)? You might also consider modifying your application so that it displays the values of the environment parameters you expect to be set.
Example: