php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41289 PDO_OCI doesn't compile
Submitted: 2007-05-04 17:46 UTC Modified: 2007-05-11 12:08 UTC
From: brunofr at ioda dot net Assigned: wez (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.2.2 OS: Linux OpenSUSE 10.1
Private report: No CVE-ID: None
 [2007-05-04 17:46 UTC] brunofr at ioda dot net
Description:
------------
when you try to compile php with pdo it finish with error unknown oracle version ( instantclient 10.2.0.3 install)
oci extension compile right.

I've reported this in http://pecl.php.net/bugs/bug.php?id=9689
but have not been resolved.

If i force PDO_OCI_VERSION=10.2 everything compile correctly.
and the extension as far i can test work nicely.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-04 17:58 UTC] tony2001@php.net
Where is libclntsh.so and does it have 10.1 suffix?
 [2007-05-05 10:12 UTC] brunofr at ioda dot net
here the ls
ll /usr/lib/oracle/10.2.0.3/client
total 103400
-r--r--r-- 1 root root  1600090 2006-11-15 21:37 classes12.jar
-rwxrwxr-x 1 root root    67053 2006-11-15 21:37 genezi
-r--r--r-- 1 root root     1525 2006-11-15 21:38 glogin.sql
lrwxrwxrwx 1 root root       47 2007-05-04 19:05 include -> /usr/include/oracle/10.2.0.3/client/sdk/include
lrwxrwxrwx 1 root root       17 2006-12-24 23:50 libclntsh.so -> libclntsh.so.10.1
-rwxrwxr-x 1 root root 18825267 2006-11-15 21:37 libclntsh.so.10.1
-r-xr-xr-x 1 root root    27822 2006-11-15 21:38 libheteroxa10.so
-r-xr-xr-x 1 root root  5486009 2006-11-15 21:37 libnnz10.so
lrwxrwxrwx 1 root root       15 2006-12-24 23:50 libocci.so -> libocci.so.10.1
-rwxrwxr-x 1 root root  1398088 2006-11-15 21:37 libocci.so.10.1
-rwxrwxr-x 1 root root 72480394 2006-11-15 21:37 libociei.so
-r-xr-xr-x 1 root root   120135 2006-11-15 21:37 libocijdbc10.so
-r-xr-xr-x 1 root root  1434235 2006-11-15 21:38 libsqlplusic.so
-r-xr-xr-x 1 root root  1057777 2006-11-15 21:38 libsqlplus.so
-r--r--r-- 1 root root  1545954 2006-11-15 21:37 ojdbc14.jar
-r--r--r-- 1 root root  1645114 2006-11-15 21:38 orai18n.jar
lrwxrwxrwx 1 root root       39 2006-12-24 16:04 sdk -> /usr/include/oracle/10.2.0.3/client/sdk
-r-xr-xr-x 1 root root     8867 2006-11-15 21:38 sqlplus
 [2007-05-05 11:41 UTC] tony2001@php.net
Assigned to the maintainer.
You can put the libraries to /usr/lib/oracle/10.2.0.3/client/lib/ for now, it should help.
 [2007-05-05 13:04 UTC] brunofr at ioda dot net
Have make link for all .so into directory lib make link lib32,lib64 to lib but doesn't help so much.

the only thing that really help is putting a PDO_OCI_VERSION=10.2 at line 71961 of .configure and every thing compile correctly after that.

something is wrong in this block of configure's code

 echo $ac_n "checking Oracle version""... $ac_c" 1>&6
echo "configure:71938: checking Oracle version" >&5
  if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then
    PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/  */:/g' | cut -d: -f 6 | cut -c 2-4`
    test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3
  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
    PDO_OCI_VERSION=10.1
  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
    PDO_OCI_VERSION=9.0
  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
    PDO_OCI_VERSION=8.1
  elif test -f $PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME.1.0; then
    PDO_OCI_VERSION=8.0
  elif test -f $PDO_OCI_LIB_DIR/libclntsh.a; then
    if test -f $PDO_OCI_LIB_DIR/libcore4.a; then
      PDO_OCI_VERSION=8.0
    else
      PDO_OCI_VERSION=8.1
    fi
  else
    { echo "configure: error: Oracle-OCI needed libraries not found under $PDO_OCI_DIR" 1>&2; exit 1; }
  fi
  echo "$ac_t""$PDO_OCI_VERSION" 1>&6

  fi

But what I can't find where ...
 [2007-05-05 13:10 UTC] tony2001@php.net
Did you try using this syntax: --with-pdo-oci=instantclient,/usr,10.2.0.3 ?
 [2007-05-05 13:38 UTC] brunofr at ioda dot net
Ok find a solution that's not a craky hack

Before ./configure 
# For Oracle client
export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client:$LD_LIBRARY_PATH
export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client

configure option for oracle :
 --with-oci8=shared,instantclient,$ORACLE_HOME,10.2.0.3 \
 --with-pdo-oci=shared,instantclient,$ORACLE_HOME,10.2.0.3 \

And everything goes nicely ... 

I think this trick should be added somewhere in the php website doc for the oci and pdo_oci compilation.
Or/And in the configure --help 

Good work guys as always :-))
If someone could confirm this recette, we can close the bug.
 [2007-05-11 12:00 UTC] tony2001@php.net
Well, that's exactly what ./configure --help says:
  --with-pdo-oci=DIR      PDO: Oracle-OCI support. Default DIR is ORACLE_HOME.
                            You may also use --with-pdo-oci=instantclient,prefix,version to use
                            the InstantClient SDK. For Linux with 10.1.0.3 rpms (for example) use:
                            --with-pdo-oci=instantclient,/usr,10.1.0.3

 [2007-05-11 12:08 UTC] brunofr at ioda dot net
Thank tony, I think i shouldn't try to compile somewhere in the middle of the night, 
I've replace the last , by / and that's why it doesn't work.

So now closing this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 19:01:29 2024 UTC