[FASTCGI] Apache fastcgi issue
sxk1969 at hotmail.com
Fri Jun 26 11:11:52 EDT 2009
I'm using Apache and fastcgi to develop a server side static fastcgi C application. What I would like to do is to pass in 3 different values (delineating different unix filepaths and directories) to the fastcgi application when it starts up. I've read the mod_fastcgi docs in detail and they specify the following:
-initial-env name[=[value]] (none)
A name-value pair to be passed in the FastCGI application's initial environment. To pass a
variable from Apache's environment, don't provide the "=" (if the variable isn't
actually in the environment, it will be defined without a value). To define a variable without a value,
provide the "=" without any value. The option can be used repeatedly.
So after reading the above I added the following in my httpd.conf file:
FastCgiServer /path/to/my/fastcgiapp -initial-env 'clientconfigfile=/path/to/my/config'
My application starts up fine but when I try to use getenv("clientconfigfile") or FCGX_GetParam("clientconfigfile",env) to try to access the contents of the environment variable passed in neither seem to work.
So I then tried to remove the equals sign inside my httpd.conf like the following:
FastCgiServer /path/to/my/fastcgiapp -initial-env 'clientconfigfile /path/to/my/config'
My fastcgi application didnt start at all in the above case, if someone has used the above argument can they provide some examples on how to get that working for a static Fastcgi application, and more importantly how to then access the contents of that environment variable inside the C code.
Thanks very much for your help.
Hotmail® has ever-growing storage! Don’t worry about storage limits.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the FastCGI-developers