php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37284 oci8.c doesn't compile against Oracle 8.0.5
Submitted: 2006-05-02 20:27 UTC Modified: 2006-05-12 01:00 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: jnavratil at houston dot rr dot com Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 5.1.3 OS: Solaris 8
Private report: No CVE-ID: None
 [2006-05-02 20:27 UTC] jnavratil at houston dot rr dot com
Description:
------------
oci8.c references undeclared OCI_ATTR_SERVER_STATUS and OCI_SERVER_NORMAL which are not defined in Oracle 8.0.5 headers (they appear to have been first defined in 9i).  The result is a compile failure of oci8.c.

Reproduce code:
---------------
configure --with-oci8=${ORACLE_HOME}
make

Expected result:
----------------
build of oci8 extension.

Actual result:
--------------
/bin/sh /usr/local/src/php-5.1.3/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext/oci8/ -I/usr/local/src/php-5.1.3/ext/oci8/ -DPHP_ATOM_INC -I/usr/local/src/php-5.1.3/include -I/usr/local/src/php-5.1.3/main -I/usr/local/src/php-5.1.3 -I/usr/local/include/libxml2 -I/usr/local/ssl/include -I/usr/local/include -I/usr/local/src/php-5.1.3/ext/date/lib -I/usr/local/include/freetype2 -I/u00/app/oracle/product/8.0.5/rdbms/demo -I/u00/app/oracle/product/8.0.5/network/public -I/u00/app/oracle/product/8.0.5/plsql/public -I/usr/local/src/php-5.1.3/TSRM -I/usr/local/src/php-5.1.3/Zend  -D_POSIX_PTHREAD_SEMANTICS  -I/usr/local/include -g -O2  -c /usr/local/src/php-5.1.3/ext/oci8/oci8.c -o ext/oci8/oci8.lo
/usr/local/src/php-5.1.3/ext/oci8/oci8.c: In function `php_oci_connection_status':
/usr/local/src/php-5.1.3/ext/oci8/oci8.c:1384: error: `OCI_ATTR_SERVER_STATUS' undeclared (first use in this function)
/usr/local/src/php-5.1.3/ext/oci8/oci8.c:1384: error: (Each undeclared identifier is reported only once
/usr/local/src/php-5.1.3/ext/oci8/oci8.c:1384: error: for each function it appears in.)
/usr/local/src/php-5.1.3/ext/oci8/oci8.c:1386: error: `OCI_SERVER_NORMAL' undeclared (first use in this function)
make: *** [ext/oci8/oci8.lo] Error 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-02 20:30 UTC] jnavratil at houston dot rr dot com
(Got OS wrong initially)
 [2006-05-02 20:38 UTC] tony2001@php.net
Unfortunately I don't have Oracle8, so I can't test and/or fix it. 
I should also note that it was decided to drop Oracle8 support, but I think the patch could be accepted.
 [2006-05-02 23:37 UTC] jnavratil at houston dot rr dot com
If Oracle 8 support is to be dropped (not unreasonable, though unfortunate), then we probably need to update the documentation which claims support for Oracle 7 and 8.

That said, I was reading oci8.c and determined that the offending routine checks the server connection status and is used prior to attempting to "ping" the server as part of a check to see if the server hasn't dropped the connection.  If that is so, could the 'php_oci_connection_status()' routine simply return success (i.e. '1') and let the ping use OCIServerVersion to test the connection?  I will test this approach on my 8.0.5 machine, although no program is ever proven correct through testing.

Assuming you think this approach is justified, can you think  of a way to determine which major/minor version introduced these preprocessor variables.  My searches have been inconclusive.
 [2006-05-03 07:09 UTC] tony2001@php.net
>If Oracle 8 support is to be dropped (not unreasonable,
> though unfortunate), then we probably need to update the
> documentation which claims support for Oracle 7 and 8.

OCI8 does support older Oracle versions on the server, but you can always install Oracle Instant Client on the client side and use it instead of ancient client version.

>Assuming you think this approach is justified, can you
>think  of a way to determine which major/minor version
>introduced these preprocessor variables.

No idea.
But you can always do it this way:
http://tony2001.phpclub.net/dev/tmp/oracle8.diff
(run `./cvsclean &&./buildconf --force` after applying this patch)

 [2006-05-03 22:30 UTC] jnavratil at houston dot rr dot com
I'm sure I don't understand your comment that OCI8 supports older versions on the server.  I am building on an 8.0.5 service and the oci.h doen't have the missing preprocessor variables.  What am I misunderstanding?

As I suggested I would, I attempted to have 'php_oci_connection_status()' return success.  oci8.c would then build, but oci_lob.c showed more of the same types of messages.  This approach appears to be a non-starter.

I then built using instantclient (all on the 8.0.5. server box).  It appears to succeed, but a simple test program attempting to oci_pconnect() to the database resulted in the ORA-3134 error that communication with this server is no longer supported.  I bumped into the same problem with a 10g client attempting to talk to an 8.0.5 server.

It appears that the current oci8 extension will talk to 8.1.7 servers (according to Oracle documentation) or later.

My next attempt will be to try to build php 5.1.3 with the oci8 extension from 5.0.4.  Do you have any other suggestions?
 [2006-05-04 07:01 UTC] tony2001@php.net
Yes, I still have the same suggestion:
patch it and send me the diff.
 [2006-05-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 21 09:00:02 2025 UTC