php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56679 PDO-OCI does not find headers from Instant Client ZIP install
Submitted: 2005-11-28 21:37 UTC Modified: 2021-05-16 04:22 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: cjbj at hotmail dot com Assigned: cmb (profile)
Status: No Feedback Package: PDO OCI
PHP Version: 5_1 CVS-2005-11-28 OS: Max OSX, Linux
Private report: No CVE-ID: None
 [2005-11-28 21:37 UTC] cjbj at hotmail dot com
Description:
------------
Configure fails without finding the Oracle Instant Client headers.
See http://forums.oracle.com/forums/thread.jspa?threadID=343352 for a
user occurrence of this problem on Mac OSX:

  ./configure --with-pdo-oci=instantclient,/usr/local/oracle/instantclient10_1/,10.1.0.3

  Error:
  checking for oci.h... configure: error: I'm too dumb to figure out
  where the include dir is in your instant client install

An Instant Client install from the ZIPs puts the libs in
instantclient10_1 or instantclient_10_2 and the headers in
instantclient10_1/sdk/include or instantclient_10_2/sdk/include.

(For an Instant Client RPM install, the oracle libs will be in /usr/lib and the headers will be in /usr/include,
e.g. /usr/include/oracle/10.2.0.1/client/oci.h)

Here's a temporary patch.  It has been tested only with 10.2 ZIP
install on Linux.

--- config.m4.orig	2005-09-25 10:30:44.000000000 +1000
+++ config.m4	2005-11-29 13:08:29.287748520 +1100
@@ -61,10 +61,19 @@
     elif test -f $PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include/oci.h ; then
       PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
       AC_MSG_RESULT($PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/include)
+    elif test -f $PDO_OCI_IC_PREFIX/sdk/include/oci.h ; then
+      PHP_ADD_INCLUDE($PDO_OCI_IC_PREFIX/sdk/include)
+      AC_MSG_RESULT($PDO_OCI_IC_PREFIX/sdk/include)
     else
       AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your instant client install])
     fi
-    PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
+    if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.so"; then
+      PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
+    elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so"; then
+      PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
+    else
+      AC_MSG_ERROR([I'm too dumb to figure out where the libraries are in your instant client install])
+    fi
     PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
   else
     if test -d "$PDO_OCI_DIR/rdbms/public"; then

After applying this patch, remove "configure" and 
autom4te.cache, and then run buildconf


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-09 11:29 UTC] php-bugs at danslereseau dot com
This patch doesn't completely fix building with pdo-oci on Mac OS X:

checking for oci.h... ./instantclient10_1/sdk/include
configure: error: I'm too dumb to figure out where the libraries are in your instant client install

It does fix the problem with finding the oci.h file, but it then check for a libclntsh.so file, which is not included in the Mac OS X InstantClient ZIP file.
The test -f should use "libclntsh.$SHLIB_SUFFIX_NAME", not "libclntsh.so".

I also had to:
ln -s libclntsh.dylib.10.1 libclntsh.dylib
but I don't think that's related.

Without this last symlink, I was getting this error:

checking Oracle Instant Client version... configure: error: Link from ./instantclient10_1/libclntsh.dylib to libclntsh.dylib.10.1 not found

Finally, after those two errors were fixed, I was getting:

checking for oci.h... ./instantclient10_1/sdk/include
configure: error: Unsupported Oracle version! 

It seems the configure scripts tries to use directory names to guess the version of Oracle when using InstantClient.
For Mac OS X, it should try to guess it using the filename of libclntsh.$SHLIB_SUFFIX_NAME.10.1

Here's a patch tested with Mac OS X 10.4 and InstantClient 10.1 (ZIP files).

*** ext/pdo_oci/config.m4.orig        Wed Feb 15 21:03:13 2006
--- ext/pdo_oci/config.m4       Sat Sep  9 11:27:59 2006
***************
*** 96,111 ****
      else
        AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your instant client install])
      fi
!     if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.so" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
!     elif test -f "$PDO_OCI_IC_PREFIX/client/lib/libclntsh.so" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/client/lib"
!     elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.so" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
      else
        AC_MSG_ERROR([I'm too dumb to figure out where the libraries are in your instant client install])
      fi
-     PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
    else
      if test -d "$PDO_OCI_DIR/rdbms/public"; then
        PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public)
--- 96,120 ----
      else
        AC_MSG_ERROR([I'm too dumb to figure out where the include dir is in your instant client install])
      fi
!     PDO_OCI_VERSION="`echo $PDO_OCI_IC_VERS | cut -d. -f1-2`"
!     if test -f "$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib/libclntsh.$SHLIB_SUFFIX_NAME" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/lib/oracle/$PDO_OCI_IC_VERS/client/lib"
!     elif test -f "$PDO_OCI_IC_PREFIX/client/lib/libclntsh.$SHLIB_SUFFIX_NAME" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX/client/lib"
!     elif test -f "$PDO_OCI_IC_PREFIX/libclntsh.$SHLIB_SUFFIX_NAME" ; then
        PDO_OCI_LIB_DIR="$PDO_OCI_IC_PREFIX"
+       if 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
+       fi
      else
        AC_MSG_ERROR([I'm too dumb to figure out where the libraries are in your instant client install])
      fi
    else
      if test -d "$PDO_OCI_DIR/rdbms/public"; then
        PHP_ADD_INCLUDE($PDO_OCI_DIR/rdbms/public)
 [2006-11-12 12:17 UTC] chuck at horde dot org
Using PHP 5.2.0, also on MacOS, configure finishes successfully (it finds the libraries and headers), but it doesn't add the oracle includes to the -I paths for compilation, so compile bails out quickly not finding oci.h. The instantclient files are in /usr/local/oracle/instantclient, with the .h files in /usr/local/oracle/instantclient/sdk/include.

(Even if I copy those files into an include directory that is checked the build fails, but that's because the oracle libs aren't universal and I have an intel mac, which is definitely not PHP's problem.)
 [2010-01-13 06:02 UTC] j dot kaluza at redcross-transfusion dot be
I think this workaround should be inserted in the package if possible it's been old story already and it's not in the downloadable package yet. Some students i know are stuck with that problem. Actually the best solution would be a configure option that et the user specify where is the oracle headers such as --with-oci-headers='/path/to/instantclient/headers'.
This kind of problem will occur everytime Oracle will change the directories structure :/
 [2021-05-03 11:35 UTC] cmb@php.net
-Status: Open +Status: Feedback -Package: PDO_OCI +Package: PDO OCI -Assigned To: +Assigned To: cmb
 [2021-05-03 11:35 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-05-16 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC