[FASTCGI] FastCGI with Oracle

A. M. ArunKumar arun at eagle-india.com
Fri Dec 4 06:07:07 EST 2009


Thank you Rob Lemley,

I was not able to work on this issue yesterday.  Today I was able to resolve
it.  The solution which you gave me was not helping, but there was another
gentleman who helped me out there.  Looks like Fast CGI is clearing the
environmental variables, we need to set it back in the C++ program.  I used
the setenv function in c++ and now its connecting to oracle.

Thanks for the timely reply.

Arun

-----Original Message-----
From: Rob Lemley [mailto:rclemley at booksys.com] 
Sent: Wednesday, December 02, 2009 8:52 PM
To: A. M. ArunKumar
Cc: fastcgi-developers at mailman.pins.net
Subject: Re: [FASTCGI] FastCGI with Oracle

A. M. ArunKumar wrote:

> I am new to this FastCGI.  I have an issue in connecting to Oracle
> database through fast CGI using my C++ program.  I get the error as
> "Cannot Create OCI Environment"  The same program works fine without
> fast CGI.  The issue happens to be only in FastCGI.

I don't know anything about connecting to Oracle and your description is
a little sketchy.

My  best guess is that your C++ program is not getting the correct
environment variables.  If that's your problem and you're running
internal FastCgiServer (as opposed to FastCgiExternalServer), you need
to pass the environment variables like this:


FastCgiServer  yourapp \
    -initial-env ORACLE_BASE=app/oracle  \
    -initial-env ORACLE_SID=DEVPORC1 \
    -initial-env yadayadayada=etcetera


> 
>
> I defined the following SetEnvs to work in cgi-bin
>
> 
>
> <Location "/cgi-bin/">
>
>   SetEnv
>
>   SetEnv ORACLE_HOME "/app/oracle/product/10.2.0/db_1"
>
>   SetEnv ORACLE_SID "DEVPORC1"
>
>   SetEnv OCILIB_INC "/usr/local/include"
>
>   SetEnv OCILIB_LIB "/usr/local/lib"
>
>   SetEnv LD_LIBRARY_PATH "/app/oracle/product/10.2.0/db_1"
>
> </Location>
>
> 
>
> 
>
> If I do the same thing for fcgi-bin its not working.
>





More information about the FastCGI-developers mailing list