[mod_python] Re: DCOracle2 w/ apache + mod_python under rh7.2 ?

Praveen Kumar pk1u at yahoo.com
Sun Jul 14 16:58:17 EST 2002


> 1) make sure you have set ORACLE_HOME env var.
> 2) make sure you have set LD_LIBRARY_PATH (to
> $ORACLE_HOME/lib) env var.
> 3) make sure that both of them are set _before_ the
> ecript execution.

Didn't work. I got around it by using mod_python as a
DSO, and using apache's LoadFile directive; in
httpd.conf:

LoadFile /home/pk/OraHome1/lib/libclntsh.so.9.0 

Not ideal, but it works.

pk

--- "Eugene V. Dvurechenski" <jno at glasnet.ru> wrote:
> On Mon, Jul 08, 2002 at 04:55:05PM -0700, Praveen
> Kumar wrote:
> >     import dco2
> > 
> > ImportError: libclntsh.so.9.0: cannot open shared
> > object file: No such file or directory
> 
> 1) make sure you have set ORACLE_HOME env var.
> 2) make sure you have set LD_LIBRARY_PATH (to
> $ORACLE_HOME/lib) env var.
> 3) make sure that both of them are set _before_ the
> ecript execution.
> 
> the last point is essential - os.environ doesn't
> help much.

Orig msg:

> Has anyone successfully used DCOracle2 w/ apache +
> mod_python under rh7.2 ?
> 
> My system consists of rh7.2, apache1.3.26,
> mod_python-2.7.8, python2.1.3, Oracle9i .
> 
> I see the following when my program accesses the
> DCOracle2 module:
> 
>   File
>
"/usr/lib/python2.1/site-packages/DCOracle2/__init__.py",
> line 37, in ?
>     from DCOracle2 import   *
> 
>   File
>
"/usr/lib/python2.1/site-packages/DCOracle2/DCOracle2.py",
> line 104, in ?
>     import dco2
> 
> ImportError: libclntsh.so.9.0: cannot open shared
> object file: No such file or directory
> 
> 
> 
> I've tried the following:
> 
> -----
> 
> Setting LD_LIBRARY_PATH from the same shell where I
> start apache:
> 
> export LD_LIBRARY_PATH=/home/pk/OraHome1/lib
> 
> -----
> 
> Setting LD_LIBRARY_PATH to /home/pk/OraHome1/lib via
> Apache's PassEnv and SetEnv directives.
> 
> -----
> 
> Placed libclntsh.so.9.0 in
> /usr/lib/python2.1/site-packages/DCOracle2 ( same
> path
> as dco2.so ).
> 
> -----
> 
> Added /home/pk/OraHome1/lib to /etc/ld.so.conf , and
> executed /sbin/ldconfig as root.
> 
> -----
> 
> Tried adding each of:
> 
> os.putenv( 'LD_LIBRARY_PATH',
> '/home/pk/OraHome1/lib'
> )
> 
> os.environ[ 'LD_LIBRARY_PATH' ] =
> '/home/pk/OraHome1/lib'
> 
> in DCOracle2/DCOracle2.py before the "import dco2"
> statement
> 
> -----
> 
> /home/pk/OraHome1/lib is readable by all ; but tried
> the following anyway, to eliminate a
> permissions-issue
> as the cause:
> 
> As root, copied /home/pk/OraHome1/lib to /oralib ;
> tried all of the above, using /oralib
> 
> -----
> 
> "/home/pk/OraHome1/lib/libclntsh.so.9.0" exists, yet
> none of these work. The DCOracle2 module works fine
> when I use it from a standalone program. It would be
> helpful to know if anyone has gotten this config to
> work; also, any suggestions would be appreciated.
> 
> pk
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com



More information about the Mod_python mailing list