导入错误:带有python wsgi的oracle客户端库

时间:2019-07-10 16:43:39

标签: python django oracle apache

当我部署时没有任何问题可以运行,但是当我尝试使用apache wsgi运行时出现此错误:DatabaseError:DPI-1047:无法找到64位Oracle Client库:“ libclntsh.so:无法打开共享对象文件:没有这样的文件或目录“

试图在环境LD_LIBRARY_PATH上使用ldconfig和设置,但是没有用。该服务器是Linux x64,带有cx_oracle 7.2.0和django 1.11.22(带有python 2.7.15+)并安装了libaio。

root@webservice:/opt/instantclient_11_2# ls -la
lrwxrwxrwx 1 root root        17 Jul 10 15:41 libclntsh.so -> libclntsh.so.11.1
-rwxrwxr-x 1 root root  53865194 Aug 24  2013 libclntsh.so.11.1
-r-xr-xr-x 1 root root   7996693 Aug 24  2013 libnnz11.so
lrwxrwxrwx 1 root root        15 Jul 10 15:41 libocci.so -> libocci.so.11.1
-rwxrwxr-x 1 root root   1973074 Aug 24  2013 libocci.so.11.1
-rwxrwxr-x 1 root root 118738042 Aug 24  2013 libociei.so
-r-xr-xr-x 1 root root    164942 Aug 24  2013 libocijdbc11.so
-r--r--r-- 1 root root   2091135 Aug 24  2013 ojdbc5.jar
-r--r--r-- 1 root root   2739616 Aug 24  2013 ojdbc6.jar
-rwxrwxr-x 1 root root    192365 Aug 24  2013 uidrvci
-rw-rw-r-- 1 root root     66779 Aug 24  2013 xstreams.jarre


root@webservice:/opt/instantclient_11_2# cat /etc/ld.so.conf.d/oracle-instantclient.conf
/opt/instantclient_11_2

1 个答案:

答案 0 :(得分:0)

导出LD_RUN_PATH:

export LD_RUN_PATH=$LD_LIBRARY_PATH