ID:               41941
 Updated by:       [EMAIL PROTECTED]
 Reported By:      wdierkes at 5dollarwhitebox dot org
-Status:           Assigned
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: Redhat Enterprise Linux
 PHP Version:      5.2.3
 Assigned To:      sixd
 New Comment:

Oracle doesn't distribute x64 RPMs for Instant Client, though there has
been some discussion about it.  Who created the RPMs you are using?


Previous Comments:
------------------------------------------------------------------------

[2007-07-09 17:29:16] wdierkes at 5dollarwhitebox dot org

Description:
------------
Related to Bug 35471 - could not open/comment on that bug report.

Oracle InstantClient 10.2.0.3 (RPM)
Redhat Enterprise Linux 3/4 x86_64

configure ....
--with-oci8=shared,instantclient,/usr/lib64/oracle/10.2.0.3/client/lib


When compiling php-5.2.3 on x86_64, configure fails with the
following:

...
checking Oracle Instant Client directory...
/usr/lib64/oracle/10.2.0.3/client/lib
checking Oracle Instant Client SDK header directory... configure:
error: Oracle Instant Client SDK header files not found


The issue is at the following line (around line 345-350) in
php-5.2.3/ext/oci8/config.m4:

OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e
's!^/usr/lib/oracle/\(.*\)/client/lib[/]*$!/usr/include/oracle/\1/client!'`


Obviously, $OCISDKRPMINC is hardcoded to sed up the line based on
'/usr/lib'.  This should be 32bit/64bit savvy, or can just as easily be
done differently.  The following patch resolved the issue: 

http://devel.5dollarwhitebox.org/patches/php-5.2.3-oci8-lib64.patch


--- php-5.2.3/ext/oci8/config.m4.oci8   2007-05-04 06:30:37.000000000
-0500
+++ php-5.2.3/ext/oci8/config.m4        2007-07-09 11:49:26.000000000
-0500
@@ -345,7 +345,8 @@
   AC_MSG_CHECKING([Oracle Instant Client SDK header directory])
 
 dnl Header directory for Instant Client SDK RPM install
-  OCISDKRPMINC=`echo "$PHP_OCI8_INSTANT_CLIENT" | $PHP_OCI8_SED -e
's!^/usr/lib/oracle/\(.*\)/client/lib[/]*$!/usr/include/oracle/\1/client!'`
+  INSTANT_CLIENT_VERSION=`echo "$PHP_OCI8_INSTANT_CLIENT" | awk -F /
{' print $5 '}` 
+  OCISDKRPMINC="/usr/include/oracle/${INSTANT_CLIENT_VERSION}/client"
 
 dnl Header directory for Instant Client SDK zip file install
   OCISDKZIPINC=$PHP_OCI8_INSTANT_CLIENT/sdk/include


A cleaner and more flexible solution would be to add a '--oci8-include'
option along with the standard '--with-oci8' option.  Basically...  the
directory passed to '--with-oci8' directs configure to the path where
the library files are....  The rest of the code is assuming that the
header files are in a set location
'/usr/include/oracle/<version>/client'...  there should be an option to
override this location of oci.h.

Reproduce code:
---------------
configure ....
--with-oci8=shared,instantclient,/usr/lib64/oracle/10.2.0.3/client/lib

Expected result:
----------------
configure properly finds oci.h in the default include dir for oracle.

Actual result:
--------------
checking Oracle Instant Client directory...
/usr/lib64/oracle/10.2.0.3/client/lib
checking Oracle Instant Client SDK header directory... configure:
error: Oracle Instant Client SDK header files not found


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41941&edit=1

Reply via email to