From: msquillace at sogei dot it Operating system: Red Hat Enterprise Linux AS 3.0 PHP version: 5CVS-2005-01-10 (dev) PHP Bug Type: OCI8 related Bug description: oci_connect fails if NLS_LANG != default
Description: ------------ We normally set NLS_LANG=ITALIAN_ITALY.WE8ISO8859P1 in the Apache startup script, mirroring the setting used on the Oracle server, and this has always worked flawlessly with PHP up to version 4.3.0, the one we still run in production. For a new project though we installed PHP 5.0.3 with Oracle 10g (client only; the RDBMS is on another machine) and found that the only way to successfully connect to Oracle from a PHP script is to comment out the NLS_LANG export and go back to the default (American_America.something), otherwise one gets: PHP Warning: oci_connect(): OCISessionBegin: ORA-00604: error occurred at recursive SQL level 1 ORA-00911: invalid character in /opt/web/php/prova_oracle.php on line 2 Here is the minimal script reproducing the error (the credentials have been modified for security reasons, but we tried several with identical results): <?php $conn = oci_connect("user", "passwd", "db1"); ?> It may be useful to note that if any one of the arguments is invalid (wrong username and/or password, or non-existant db instance) the OCI8 extensions works as expected, reporting the correct Oracle errors; so the problem happens after the user is authenticated, when it is time to create a connection to the DB server. Today we downloaded the 09:30 CVS snapshot of PHP 5 and upgraded the OCI8 extension, but the problem remains (this was somewhat expected, as the oci8.c diff didn't show extensive modifications). If confirmed, I believe this is a serious bug affecting most non-English speaking PHP users. Reproduce code: --------------- <?php $conn = oci_connect("user", "passwd", "db1"); ?> -- Edit bug report at http://bugs.php.net/?id=31476&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31476&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31476&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31476&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=31476&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=31476&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=31476&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=31476&r=needscript Try newer version: http://bugs.php.net/fix.php?id=31476&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=31476&r=support Expected behavior: http://bugs.php.net/fix.php?id=31476&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=31476&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=31476&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=31476&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31476&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=31476&r=dst IIS Stability: http://bugs.php.net/fix.php?id=31476&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=31476&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=31476&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=31476&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=31476&r=mysqlcfg