ID: 40542 Updated by: [EMAIL PROTECTED] Reported By: marvin at chag dot net -Status: Open +Status: Suspended Bug Type: OCI8 related Operating System: Linux PHP Version: 5.2.1 New Comment:
>So maybe another env. variable tries to "alter session"? I doubt env variables might "alter session" and even if they do, it's not PHP problem. Changing the status to suspended - I'm unable to reproduce it and I believe it's something wrong with your system or the client lib. Previous Comments: ------------------------------------------------------------------------ [2007-02-23 09:09:45] marvin at chag dot net I tried the workaround jmgonet kindly rovided and removed all NLS_LANG setting from environment and startup scripts of the Apache server. The problem persists in exactly the same way as before. Adding the charset to the OCILogon did not help either. So maybe another env. variable tries to "alter session"? ------------------------------------------------------------------------ [2007-02-23 08:43:23] jmgonet at iware dot ch 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. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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