Re: Apache 1.2b6, Oracle7, and FastCGI 1.4.3

Stanley Gambarin (gambarin@OpenMarket.com)
Wed, 12 Feb 1997 11:39:28 -0500

Message-Id: <199702121639.LAA04378@u4-138.openmarket.com>
To: "Noah M. Couture" <noah@myriadagency.com>
Subject: Re: Apache 1.2b6, Oracle7, and FastCGI 1.4.3 
In-Reply-To: Your message of "Wed, 12 Feb 1997 10:22:29 EST."
             <Pine.GSO.3.95.970212100945.16201L-100000@geyser.myriadagency.com>
Date: Wed, 12 Feb 1997 11:39:28 -0500
From: Stanley Gambarin <gambarin@OpenMarket.com>

> 
> Heres the problem. Im writing a C (Pro*C) web application. It is compiled
> with Oracle shared libraries. In order for the operating system
> (Solaris 2.5.1, btw) to load the executable, it needs to find the Oracle
> libraries. In order for this to happen, the LD_LIBRARY_PATH environment
> variable must include their path. There are also a couple of other environment
> vars that Oracle likes. Heres what I tried:
> 
> AppClass /disk/columbia/website/www/browse.fcgi -initial-env ORACLE_HOME=/ora01/
> app/oracle/product/7.3.2 -initial-env LD_LIBRARY_PATH=/ora01/app/oracle/product/
> 7.3.2/lib -initial-env ORACLE_SID=jrc
> 
> However, it did not work. I still get this:
> 
> ld.so.1: browse-autos.cgi: fatal: libclntsh.so.1.0: can't open file: errno=2
> 
	There are a few suggestions that come to mind.  First make sure that
your program only requires libraries that are in /ora01/app/oracle/product/7.3.
2/lib and not in any other directory,
otherwise you will have to change above to set multiple directories to the
above variable.  If that does not work, you can use Apache's feature to 
set the environment variables per requrest (mod_env) but i doubt it will 
provide any better effect.  Finally, you can follow the advice that is 
suggested in the shared libraries FAQ (for Solaris), which I found at:
http://www.st.rim.or.jp/~kazus/FAQ/shared.faq.html  The short excerpt is as 
follows:
Q. What is LD_LIBRARY_PATH?

A. LD_LIBRARY_PATH is an environment variable that tells the system where
   to find shared libraies when they are needed, if the program itself
   does not specify this information. You can view the current value of
   this variable by typing "echo $LD_LIBRARY_PATH" in a shell. The
   contents consist of a colon separated list of directories to search
   sequentially. If it is not set, the default is "/usr/lib".

   If LD_LIBRARY_PATH does not list the directory where a particular
   required library is found, and the program which requires this
   binary does not specify which directory to find it in either, then
   the program will abort. For this reason, it is considered good
   practice, when making programs, to have the program specify to
   the dynamic linker where its libraries may be found if they
   are not found in the standard directory /usr/lib. In this way, no
   program should depend on the correct setting of LD_LIBRARY_PATH.
   A program can be considered broken, or at the very least, lacking
   robustness, if it doesn't work without LD_LIBRARY_PATH set. (See also
   "Why should I use -R?")
Q. Why should I use -R when linking programs?

A. The -R option to the linker allows you to specify directories (one
   per occurence or -R) where the program being linked should look for
   its shared libraries when it is run. It should be used whenever a
   program requires libraries stored in directories other than /usr/lib,
   so that the program will find all the libraries it needs.

   Note that a similar effect can be achieved by using the LD_LIBRARY_PATH
   variable (See "What is LD_LIBRARY_PATH"), but depending on this is
   very strongly discouraged because the program will always depend
   on this variable being set correctly and it will fail to run whenever
   it isn't!

   On a properly configured system, all programs have been linked with
   -R if they need libraries from elsewhere than /usr/lib, and
   LD_LIBRARY_PATH need not be used.

						Hope that was of some help.
								Stanley.

-- 
*******************************************************************************
* To unsubscribe from the fastcgi-developers mailing list		      *
* 		mailto: fastcgi-developers-request@openmarket.com      	      *
*		with body containing: unsubscribe       		      *
* To request help for using the fastcgi-developers mailing list		      *
* 		mailto: fastcgi-developers-request@openmarket.com      	      *
*		with body containing: help		       		      *
*******************************************************************************

*******************************************************************************
* Stanley Gambarin			Open Market Inc.		      *
* FastCGI (soon-to-be) Guru		245 First St. Cambridge MA 02142      *
*					(617) - 949 - 7487		      *
* mailto:gambarin@openmarket.com					      *
* 				http://acs2.bu.edu:8001/~stanleyg (school)    *
*				mailto:stanleyg@cs.bu.edu		      *
*******************************************************************************