php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58247 no support for oracle 11.x
Submitted: 2008-06-24 02:19 UTC Modified: 2017-12-14 20:45 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 3 (66.7%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: vincent dot mcintyre at atnf dot csiro dot au Assigned: sixd (profile)
Status: Closed Package: *General Issues
PHP Version: 5.2.0 OS: Debian 4.0 (etch)
Private report: No CVE-ID: None
 [2008-06-24 02:19 UTC] vincent dot mcintyre at atnf dot csiro dot au
Description:
------------
Trying to build 1.0 against instantclient 11.1.0.1 fails at the configure stage (call to configure given in "reproduce code" section).



Reproduce code:
---------------
cd PDO_OCI-1.0; \
 /usr/bin/phpize4; \
 ./configure --with-php-config=/usr/bin/php-config4 \
  --prefix=/usr --with-pdo-oci=instantclient,/usr,11.1.0.1


Expected result:
----------------
It would be nice to be able to build against 11.x.

Actual result:
--------------
Configure stage fails with this error message:

...
checking for oci.h... /usr/include/oracle/11.1.0.1/client
configure: error: Unsupported Oracle version! 11.1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-28 08:35 UTC] jess at zend dot com
Actually, the extension compiles properly against OCI libs version 11.1 and also passes through all PHPTs successfully.
The only modification I had to make was in config.m4, adding:
<code>
  elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.11.1; then
    PDO_OCI_VERSION=11.1
</code>
Between lines 9 and 10.

And 
<code>
    11.1)
      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
      ;;
</code>
Between lines 121 and 122 of the same file.
Apart from these config,m4 changes, no code change is required. 

A few additional notes maybe no one would care about:

0. Assuming all 10.x versions are supported and not only 10.1, config.m4 can be modified to this and make it easier to add additional versions:
<code>
SUPPORTED_VERS="1 8 9 10 11"
AC_DEFUN([AC_PDO_OCI_VERSION],[
  AC_MSG_CHECKING([Oracle version])
  if test -s "$PDO_OCI_DIR/orainst/unix.rgs"; then
    PDO_OCI_VERSION=`grep '"ocommon"' $PDO_OCI_DIR/orainst/unix.rgs | sed 's/  */:/g' | cut -d: -f 6 | cut -c 2-4`
    test -z "$PDO_OCI_VERSION" && PDO_OCI_VERSION=7.3
  elif test -f $PDO_OCI_DIR/lib/libclntsh.a; then
    if test -f $PDO_OCI_DIR/lib/libcore4.a; then
      PDO_OCI_VERSION=8.x
    else
      PDO_OCI_VERSION=8.x
    fi
  else
          for OCI_VER in $SUPPORTED_VERS; do
                  if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER.*; then
                    PDO_OCI_VERSION="$OCI_VER.x"
                    echo $PDO_OCI_VERSION
                  fi
          done
  fi
  if [ -z "$PDO_OCI_VERSION" ] ;then
    { { echo "$as_me:$LINENO: error: Oracle-OCI needed libraries not found under $PDO_OCI_DIR" >&5
        echo "$as_me: error: Oracle-OCI needed libraries not found under $PDO_OCI_DIR" >&2;}
   { (exit 1); exit 1; }; }
  fi
</code>

This way, you can easily add another version, say 12, to the SUPPORTED_VERS array.

1. Also, since the PHP_ADD_LIBRARY is quite the same with all versions but 8.0 [see case statement starting on line 102], lines 110-123 can be replaced with:
<code>
    9.x|10.x|11.x)
      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
      ;;
</code>


Jess
 [2009-11-23 20:32 UTC] krbuck at mindspring dot com
None of the solutions mentioned previously in this thread worked for me.  What worked was to lie to the configure command and say that my Oracle version was 10.1.  It compiled and worked with no problems. So, my configure command would be like this:

./configure --with-pdo_oci=instantclient,path_to_oracle_instant_client,10.1

even though the Oracle version I have is 11.1.
I wish I had done this before I spent so much time trying to get it to work the proper way.

Regards,
Kenneth
 [2011-12-05 17:12 UTC] chantivla at yahoo dot fr
Well i tried with follwing config:
- php 5.2.6 installed out of the box on SLES 11 (PHP 5.2.6 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 12 2010 15:26:33))
- installed oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm and oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
- installed oci8-1.4.6 
- then i tried:

   sudo ln -s /usr/include/oracle/11.2/client64 /usr/include/oracle/11.2/client
   sudo ln -s /usr/lib/oracle/11.2/client64 /usr/lib/oracle/11.2/client
   sudo pear download http://pecl.php.net/get/pdo_oci
   cd /tmp/pear/download/PDO_OCI-1.0
   sudo tar xvf PDO_OCI-1.0.tgz
   sudo phpize
   sudo ./configure --with-pdo-oci=shared,instantclient,/usr,11.2

and it would tell me 

checking Oracle OCI support for PDO... yes, shared
checking Oracle Install-Dir... instantclient,/usr,11.2 :instantclient,/usr,11.2:
checking if that is sane... yes
checking for oci.h... /usr/lib/oracle/11.2/client/include
configure: error: Unsupported Oracle version! 11.2

Changing config.m4 as suggested did not work for me.
What worked was editing the configure script directly to make the same for 11.2 as for 10.2. Oh yes and hard code the path to php_pdo_driver.h that the script was not finding. Ugly but it worked.
 [2012-01-11 21:59 UTC] a at example dot com
Don't use PDO_OCI from PECL - it is much older than the PDO_OCI in the PHP 
releases.
 [2012-01-11 22:27 UTC] chantivlad at yahoo dot fr
Sorry my comment was incomplete before.
You say:

"Don't use PDO_OCI from PECL - it is much older than the PDO_OCI in the PHP 
releases."

But what about if you are on a machine on which PHP was not built with PDO_OCI support and you can't reinstall PHP.
Where do you find the right PDO_OCI source to install on top of the PHP installation?
 [2017-12-14 20:45 UTC] sixd@php.net
-Status: Open +Status: Closed -Package: PDO_OCI +Package: *General Issues -Assigned To: +Assigned To: sixd
 [2017-12-14 20:45 UTC] sixd@php.net
This was fixed a long time ago.

And to answer the last comment: get the source from http://php.net/downloads.php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 22:01:29 2024 UTC