【问题标题】:webgate and cx_Oracle InterfaceError: Unable to acquire Oracle environment handle;webgate 和 cx_Oracle InterfaceError:无法获取 Oracle 环境句柄;
【发布时间】:2017-09-18 07:11:13
【问题描述】:

我正在尝试在 Oracle Linux 7 上集成 webgate + apache24。 webgate + apache24 集成适用于静态页面(例如 index.html)。

另外,当我尝试使用 python + mod wsgi + apache(没有 webgate)提供 API 时,它工作正常。 Apache 能够获取环境句柄。

但是当我在 apache httpd.conf 中启用 webgate.conf 时,cx_oracle 开始抱怨 cx_Oracle 接口错误:无法获取 Oracle 环境句柄;

我已经在 /etc/sysconfig/httpd 中设置了环境变量

export ORACLE_HOME=<path to oracle_home>
export LD_LIBRARY_PATH=<path to oracle_home>:/opt/Python-3.5.2/lib
export LD_RUN_PATH=<path to oracle_home>
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/<path to oracle_home>/webgate/apache/lib/

我也在 /etc/profile 中设置了这些并重新启动了 apache 仍然无法正常工作。

当我在使用 mod_wsgi 加载的 app.py 中打印 os.environ 时,我确实看到了上述所有变量集。

附加信息,我已将 /etc/httpd/conf/http.conf ,'User' 指令修改为 'localuser'

但是我仍然继续得到同样的错误。不太清楚出了什么问题。

【问题讨论】:

    标签: python oracle apache


    【解决方案1】:

    对于 OL7 / RHEL7,/etc/sysconfig/httpd 的语法现在如下:

    ORACLE_HOME=/home/oracle/app/oracle/product/12.2.0/dbhome_1
    

    等等

    注意

    • 没有export关键字
    • 我认为您不能在等号右侧使用变量。

    【讨论】:

    • 嗨,Christorpher,我已经尝试过了,但没有成功。
    猜你喜欢
    • 2017-02-08
    • 1970-01-01
    • 2018-06-08
    • 1970-01-01
    • 1970-01-01
    • 2017-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多