php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27117 Configuration patch to compile oci8 extension with Oracle 10g
Submitted: 2004-02-02 00:36 UTC Modified: 2004-02-03 14:50 UTC
From: cjbj at hotmail dot com Assigned: tony2001 (profile)
Status: Closed Package: OCI8 related
PHP Version: 4CVS-2004-02-02 (stable) OS: RH Linux AS 3
Private report: No CVE-ID: None
 [2004-02-02 00:36 UTC] cjbj at hotmail dot com
Description:
------------
This patch to ext/oci8/config.m4 allows compilation with Oracle 10g:

--- config.m4.orig      2003-10-03 16:07:05.000000000 +1000
+++ config.m4   2004-02-02 16:09:26.000000000 +1100
@@ -23,6 +23,8 @@
   if test -s "$OCI8_DIR/orainst/unix.rgs"; then
     OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
     test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
+  elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
+    OCI8_VERSION=10.1
   elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
     OCI8_VERSION=9.0
   elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
@@ -115,6 +117,26 @@
       ])
       ;;

+    10.1)
+      PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
+      PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+      AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
+
+      dnl These functions are only available in version >= 9.2
+      PHP_CHECK_LIBRARY(clntsh, OCIEnvNlsCreate,
+      [
+        PHP_CHECK_LIBRARY(clntsh, OCINlsCharSetNameToId,
+        [
+          AC_DEFINE(HAVE_OCI_9_2,1,[ ])
+          OCI8_VERSION=10.1
+        ], [], [
+          -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+        ])
+      ], [], [
+        -L$OCI8_DIR/lib $OCI8_SHARED_LIBADD
+      ])
+      ;;
+
     *)
       AC_MSG_ERROR(Unsupported Oracle version!)
       ;;

If readers need to manually apply this patch, run ./buildconf before
running ./configure and make.

See also http://bugs.php.net/27093

To install Oracle's OCI header and library files from the Oracle 10g
Client CD, run the installer and choose the "Administrator" option.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-02 03:37 UTC] cjbj at hotmail dot com
I've grokked the m4 9.0/9.2 hack and see it isn't needed for 10.1.  The revised suggested patch is:

*** config.m4.orig	2003-10-03 16:07:05.000000000 +1000
--- config.m4	2004-02-02 19:22:57.000000000 +1100
***************
*** 23,28 ****
--- 23,30 ----
    if test -s "$OCI8_DIR/orainst/unix.rgs"; then
      OCI8_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | sed 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
      test -z "$OCI8_VERSION" && OCI8_VERSION=7.3
+   elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.10.1; then
+     OCI8_VERSION=9.0
    elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.9.0; then
      OCI8_VERSION=9.0
    elif test -f $OCI8_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.8.0; then
***************
*** 115,120 ****
--- 117,129 ----
        ])
        ;;
  
+     10.1)
+       PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
+       PHP_ADD_LIBPATH($OCI8_DIR/lib, OCI8_SHARED_LIBADD)
+       AC_DEFINE(HAVE_OCI8_ATTR_STATEMENT,1,[ ])
+       AC_DEFINE(HAVE_OCI_9_2,1,[ ])
+       ;;
+ 
      *)
        AC_MSG_ERROR(Unsupported Oracle version!)
        ;;
 [2004-02-02 03:39 UTC] cjbj at hotmail dot com
Hmmmm. Pasted from wrong buffer (or right buffer on wrong machine).  The replacement patch should have the line OCI8_VERSION=10.1, not OCI8_VERSION=9.0
 [2004-02-03 08:31 UTC] sniper@php.net
Assigned to the maintainer of ext/oci8

 [2004-02-03 14:50 UTC] sniper@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 10:01:29 2024 UTC