php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41941 oci8 extension not lib64 savvy
Submitted: 2007-07-09 17:29 UTC Modified: 2008-01-16 00:43 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: wdierkes at 5dollarwhitebox dot org Assigned: sixd
Status: Closed Package: OCI8 related
PHP Version: 5.2.3 OS: Redhat Enterprise Linux
Private report: No CVE-ID:
 [2007-07-09 17:29 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-09 23:03 UTC] sixd@php.net
Oracle doesn't distribute x64 RPMs for Instant Client, though there has been some discussion about it.  Who created the RPMs you are using?
 [2007-07-09 23:14 UTC] wdierkes at 5dollarwhitebox dot org
I built, and maintain the RPMS (internally) based off of a FedoraCore SPEC with minimal changes (I believe they dropped the package though as it was hard to find).  The 'lib' directory is based off of the '%{_libdir}' RPM macro (as it should be) placing the library data in '/usr/lib64' on an x86_64 box (as it should as well).

This issue is not with the RPM... rather the fact that '/usr/lib' is hardcoded in the config.m4 line (as described above) that determines the '/usr/include...' path for oci.h.
 [2007-07-23 18:03 UTC] sixd@php.net
Status update: I'm pushing for official Oracle 64 bit RPMs to be released and am waiting to see what directory structure they will have.
 [2007-11-29 21:28 UTC] sixd@php.net
Update: Oracle has released Instant Client x86_64 RPMs on the OTN website.  OCI8 should use the directory structure in these official RPMs. 
 [2007-11-29 22:56 UTC] tony2001@php.net
We're not going to add support for any unofficial Instant Client rpms (there is enough hassle with the official ones, so please don't add even more).

The support for official 64bit OIC rpms is currently being tested.
 [2007-12-12 05:59 UTC] Fedora at FamilleCollet dot com
Oracle now provides RPM for i386, x86_64 and even ppc

With new version 11.1, install path is "client64" and only "client" is test during "configure".
 [2007-12-12 06:02 UTC] Fedora at FamilleCollet dot com
Here is a little patch for this issue.

It handle /usr/lib64 and client64 in both oci8 and pdo_oci extension.

http://remi.collet.free.fr/files/php-5.2.5-oci8conf.patch

Regards
 [2008-01-16 00:43 UTC] sixd@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.

+------------------------------------------------------------
| Fixed in PHP 5.2.6, 5.3 and 6.  Support for
| Oracle-provided, 64bit Linux RPMs has been added.
|
| Also, --with-oci8=instantclient will now search for the
| most recent version of the Instant Client RPMs if no
| directory is specified.
+------------------------------------------------------------

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC