This discussion is archived
3 Replies Latest reply: Nov 27, 2012 7:31 PM by cj RSS

OCI 1.4.9 build problem

Gogala Mladen Expert
Currently Being Moderated
I've recently installed oci8 on my Fedora box, with Oracle instant client 11.2.0.3.0. Configuration script complained that it cannot see header files, although the necessary instant client packages are installed:

[mgogala@medo ~]$ rpm -qa|grep oracle
oracle-instantclient11.2-precomp-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-odbc-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-jdbc-11.2.0.3.0-1.x86_64
oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64

I ended up copying the contents of /usr/include/oracle/11.2/client64 to /usr/lib/oracle/11.2/client64. I also had to copy all the libraries from /usr/lib/oracle/11.2/client64/lib to /usr/lib/oracle/11.2/client64. My PHP is 5.4.8:

[mgogala@medo ~]$ php -v
PHP 5.4.8 (cli) (built: Oct 18 2012 11:47:02)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
[mgogala@medo ~]$


This was not what I would call a "seamless build". Apparently, the configuration script expects instant client to be just an unpacked blob, like for Debian derivatives, not a structured package with bin and lib directories and the headers under /usr/include.

I am running 64 bit FC 17:
[mgogala@medo ~]$ uname -a
Linux medo.home.com 3.6.6-1.fc17.x86_64 #1 SMP Mon Nov 5 21:59:35 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[mgogala@medo ~]$
  • 1. Re: OCI 1.4.9 build problem
    cj Employee ACE
    Currently Being Moderated
    What was your configure command or response to the PECL prompt?
    Also can you confirm where you got the RPMs from?
    Normally for Instant Client RPMs on RHEL/Oracle Linux I'd use:
    with-oci8=instantclient (or just with-oci8 if I don't have ORACLE_HOME set) and let the install heuristics locate the libs and header files.
    I'm more than happy to add new heuristics for common scenarios, if patches
    for platforms I don't have access to are sent in.

    If you use --with-oci8=instantclient,/somedir then, yes, it will look fot
    the 'blob' installed from the Instant Client zips.

    If the issue is the doc or inline help, send in suggestions for improvement.
  • 2. Re: OCI 1.4.9 build problem
    Gogala Mladen Expert
    Currently Being Moderated
    Yes, that was the way I used it: -with-oci8=instantclient,/usr/lib/oracle/11.2/client64
    My ORACLE_HOME was set to instantclient,/usr/lib/oracle/11.2/client64, PATH was set to $ORACLE_HOME/bin and LD_LIBRARY_PATH was set to $ORACLE_HOME/lib. TWO_TASK was set to "RAC11", which is a pair of virtual machines running RAC 11.2.0.3.4
    Instant client RPM packages were downloaded from the Oracle Technology Network. Next time around, I will do as you described.
  • 3. Re: OCI 1.4.9 build problem
    cj Employee ACE
    Currently Being Moderated
    Try with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib instead of with-oci8=instantclient,/usr/lib/oracle/11.2/client64

    I don't like to see ORACLE_HOME set for Instant Client. It's confusing to overload the variable's meaning. Use TNS_ADMIN if you need tnsnames.ora and/or sqlnet.ora files.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points