From:             wdierkes at 5dollarwhitebox dot org
Operating system: Redhat Enterprise Linux
PHP version:      5.2.3
PHP Bug Type:     Compile Failure
Bug description:  oci8 extension not lib64 savvy

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 bug report at http://bugs.php.net/?id=41941&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41941&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41941&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41941&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41941&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41941&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41941&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41941&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41941&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41941&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41941&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41941&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41941&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41941&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41941&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41941&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41941&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41941&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41941&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41941&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41941&r=mysqlcfg

Reply via email to