ID:               40542
 Comment by:       jmgonet at iware dot ch
 Reported By:      marvin at chag dot net
 Status:           Open
 Bug Type:         OCI8 related
 Operating System: Linux
 PHP Version:      5.2.1
 New Comment:

I've found the following workaround for that problem:

- Instead of setting the NLS_LANG environment variable, you can specify
the charset while establishing the connection:

$conn=oci_connect("USER","PASSWORD","SERVER","CHARSET");

Where charset should be the one used by PHP client (not the one used by
the Oracle server). In the case of a windows system, it is
"WE8MSWIN1252" (In my PHP server, this code is specified in the
NLS_LANG registry key, but oci_connect doesn't take it as default
value). It is "WE8MSWIN1252" even if the PHP is executed as a script,
from the command line.

The CHARSET for a linux/unix system may be "WE8ISO8851P1", or at least
it seems to be usual in Europe.


Previous Comments:
------------------------------------------------------------------------

[2007-02-23 07:31:42] jmgonet at iware dot ch

I have just the same problem, executing a PHP script as a Windows'
batch. I've set the NLS_LANG environment variable to
'NLS_LANG=FRENCH_SWITZERLAND.WE8PC850'.

I'm using Oracle 10 light client.

I've found in this (http://dbforums.com/t927204.html) and other forums,
a possible explanation:

'NLS_LANG cannot be changed by alter session, NLS_LANGUAGE and
NLS_TERRITORY can.'

------------------------------------------------------------------------

[2007-02-22 07:13:19] marvin at chag dot net

Hi Tony2001, 
Thank you very much for the kind offer. Unfortunately our companies
security policies does not allow such an approach. But I will happily
investigate the problem according to your requirements and send you the
debugging information & results you need to isolate the problematic
lines.

------------------------------------------------------------------------

[2007-02-20 10:03:38] [EMAIL PROTECTED]

>So I kindly ask, wether you please can tell me what else
>should cause this problem, if not PHP / OCI8?

Sure. I'd look in Oracle or in the client library.
With such an old version it's no wonder there are problems.

Though, we can try do it this way:
Please install 5.1.1 and make sure it does work fine.
Then I'll need an unprivileged ssh account on your machine to install
5.2.1, reproduce the problem and investigate it.
I'll also need Oracle connection details.

------------------------------------------------------------------------

[2007-02-20 07:52:53] marvin at chag dot net

open again

------------------------------------------------------------------------

[2007-02-19 13:37:20] marvin at chag dot net

Hi Tony2001, 

The only change to our systems is switching between PHP <= 5.1.1 and
PHP >= 5.1.2 (today it was 5.2.1). 

The result is: for PHP <= 5.1.1 the database connections are working
fine and for PHP >= 5.1.2 they are not.

So I kindly ask, wether you please can tell me what else should cause
this problem, if not PHP / OCI8?
 
Sadly upgrading this databases in this special configuration is no
option. PHP documentation http://de.php.net/manual/en/ref.oci8.php
states that OCI8 can be used for Oracle 7 and 8 databases, though.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/40542

-- 
Edit this bug report at http://bugs.php.net/?id=40542&edit=1

Reply via email to