php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42456 i foud solution, publish it on website
Submitted: 2007-08-28 09:45 UTC Modified: 2007-08-30 09:23 UTC
From: astorozhuk at ukrcard dot com dot ua Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 5.2.3 OS: sles9
Private report: No CVE-ID: None
 [2007-08-28 09:45 UTC] astorozhuk at ukrcard dot com dot ua
Description:
------------
1.look:
 
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error:
`OCI_NLS_CHARSET_MAXBYTESZ' undeclared (first use in this function)
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: (Each
undeclared identifier is reported only once
/usr/local/src/php-5.2.3/ext/oci8/oci8_lob.c:304: error: for each
function it appears in.)
make: *** [ext/oci8/oci8_lob.lo] Error 1
 
http://bugs.php.net/bug.php?id=41563&edit=1
 
[4 Jun 8:36am UTC] tony2001@php.net
Sorry, we don't support Oracle 8 anymore.
 
http://bugs.php.net/bug.php?id=41348
 
[10 May 8:05pm UTC] tony2001@php.net
Upgrade to newer Oracle version.
 
 
2. description
this things happen if compile with OCI8 support
you must understand, that it is not ORACLE 8(!) support, it is ORALCE suppurt
we have oracle9 or 10 , and OCI8   is standart library (there is no OCI9 OCI10 library, or OCI library)
 
so you replys is stupid
 
 
3.solution
 
(solution was took and analysed from http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2007-May/120308.html)
 
solution itself:
 
tar xvfz php-5.2.3.tar.gz
 
cd ext/oci8
EDIT oci8_lob.c, near line 340
add compiler commands to make text:
===================================
        if (is_clob) {
#ifdef OCI_NLS_CHARSET_MAXBYTESZ
                PHP_OCI_CALL_RETURN(connection->errcode, OCINlsNumericInfoGet, (connection->env, connection->err, &bytes_per_char, OCI_NLS_CHARSET_MAXBYTESZ));
 
                if (connection->errcode != OCI_SUCCESS) {
                        php_oci_error(connection->err, connection->errcode TSRMLS_CC);
                        PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
                        return 1;
                }
#else
                bytes_per_char = 4;
#endif
        } else {
                /* BLOBs don't have encoding, so bytes_per_char == 1 */
        }
 
===================================
added lines:
#ifdef OCI_NLS_CHARSET_MAXBYTESZ
 
 
 
#else
                bytes_per_char = 4;
#endif
===================================
 
 
 
 
 
4. TODO for you
 
please change your comments to this solution, because i had to use old php version because i dodnt know solution to make it work in new versions
and after sawing your replys i was shocked
 
places to change comments
http://bugs.php.net/bug.php?id=41563&edit=1
http://bugs.php.net/bug.php?id=41348


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-28 11:14 UTC] jani@php.net
We don't support Oracle 8 anymore. :)
 [2007-08-28 11:24 UTC] astorozhuk at ukrcard dot com dot ua
You must be realy stupid!

first read what i wrote about:
I'm telling not about oracle8, but about oracle9 and oracle10.

extension name is OCI8 , but it used for oracle from 8 to 10
NOT ONLY TO ORACLE 8 (!)
 [2007-08-28 11:28 UTC] astorozhuk at ukrcard dot com dot ua
for education read:
http://ua.php.net/oci8

<<<
CVII. Oracle Functions
Introduction

These functions allow you to access Oracle 10, Oracle 9, Oracle 8 and Oracle 7 databases using the Oracle Call Interface (OCI).
>>>


in our organization oracle versions 9 and 10
and we use oci8 extention to connect to databases
 [2007-08-28 11:53 UTC] jani@php.net
Calling people stupid is the best way to report bugs..
Upgrade your oci libs. That's the solution. I copy pasted wrong reply, I was supposed to copy this:

[10 May 8:05pm UTC] tony2001@php.net
Upgrade to newer Oracle version.

 [2007-08-28 12:04 UTC] astorozhuk at ukrcard dot com dot ua
google:

ociheaders  site:oracle.com

found
http://www.oracle.com/technology/products/ias/ohs/htdocs/php_ohs.htm

title of document: Using PHP with Oracle Application Server 10g      (! version 10)





url of headers found
http://www.oracle.com/technology/products/ias/ohs/htdocs/ociheaders.tar

wget http://www.oracle.com/technology/products/ias/ohs/htdocs/ociheaders.tar

--15:00:49--  http://www.oracle.com/technology/products/ias/ohs/htdocs/ociheaders.tar
           => `ociheaders.tar'
Resolving www.oracle.com... 141.146.8.66
Connecting to www.oracle.com[141.146.8.66]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,330,176 [application/x-tar]

100%[==================================================================================>] 1,330,176     13.60K/s    ETA 00:00

15:01:52 (22.22 KB/s) - `ociheaders.tar' saved [1330176/1330176]

md5sum ociheaders.tar
1d1cc2502e9d1e5bf95c33b5616fb604  ociheaders.tar




comparing with headers that was long time ago (few monthes), and installed on system...

#OciHeaders
#	url	http://www.oracle.com/technology/products/ias/ohs/htdocs/ociheaders.tar
#	md5	1d1cc2502e9d1e5bf95c33b5616fb604


------------------------
conclusions:
ociheaders didn't changed last few monthes
but on php-5.1.6 they worked
and now (php-5.2.3) compilling with them raise error
 [2007-08-28 21:08 UTC] tony2001@php.net
OCI8 builds and works perfectly fine with Oracle 9, 10 and 11.
It can also be used to communicate with earlier versions, though we do not support clients < 9 because of several reasons which I'm not going to explain here.

If you are using an unsupported platform (FreeBSD), then it's your responsibility to make it work - we're definitely not going to support hacks and unofficial "ports".

If you mentioned FreeBSD for another reason, then please try to be more verbose: I can see a lot of emotions in your report, but almost no useful information.
What kind of OS is that? Which version of Oracle client was used? Do you use official distribution or something manually hacked? How did you configure PHP?
Without this information the report is bogus.
 [2007-08-29 07:15 UTC] astorozhuk at ukrcard dot com dot ua
i definitly wrote in OS field - sles9 (sles9= Suse Linux Enterprise server version 9)  , service pack 3, OFFICIAL

i mention  freebsd as link, not because i use it. i found link with problem solution.


configure
./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-config-file-path=/usr/local/apache/conf --with-oci8=/oracle/as  --disable-rpath   --enable-soap --enable-iconv --enable-oracle   --with-gd -with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr  --with-zlib=/usr


(/oracle/as is oracle application server. we use also  oracle9 database. all from official installation)


version 5.1.6 compilations is normal
version 5.2.3 not compiling , error i've mentioned above


!useful information:
------------------------------------------
please add 4 lines to source of oci8 extension lines:
#ifdef OCI_NLS_CHARSET_MAXBYTESZ
#else
              bytes_per_char = 4;
#endif

in ext/oci8/oci8_lob.c, near line 340
as i mensioned above
-------------------------------------------

another questions:
why some php developers not analysing problem , but just make copy-paste, and even make errors in copy-pasting :)
 [2007-08-29 08:45 UTC] tony2001@php.net
>(/oracle/as is oracle application server. we use also  oracle9 >database. all from official installation)

What's the EXACT version number? 9.what?

>useful information:

Oh, please keep this useful information to yourself.

>please add 4 lines to source of oci8 extension lines:

Please stop telling me what to do.

>why some php developers not analysing problem , but just make
>copy-paste, and even make errors in copy-pasting :)

Why some users think they may call other people stupid and expect these very people to help them? Do you think you're clever?
Name me at least one reason why should I even listen to you after that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 01:01:30 2024 UTC