ID:               48672
 Updated by:       s...@php.net
 Reported By:      dima at dimych dot sumy dot ua
-Status:           Open
+Status:           Bogus
 Bug Type:         OCI8 related
 Operating System: FreeBSD 6.4
 PHP Version:      5.2.10
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

----

Oracle environment variables must be set prior to PHP starting.  
Otherwise different, inconsistent values can be used by Oracle
libraries 
at initialization and runtime.

Never, ever set ORACLE_HOME or NLS_LANG with putenv() in a PHP script. 

I'd also recommend the same for Perl and other dynamic languages: you 
are seeing unpredictable behavior.

See "Where do I set Oracle environment variables?" in 
http://wiki.oracle.com/page/PHP+Oracle+FAQ


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

[2009-06-24 09:11:17] dima at dimych dot sumy dot ua

Description:
------------
I`m trying to connect from my FreeBSD box using oracle8 client (from
freebsd-ports) to Oracle 8.1.7 server.
oci_new_connect fails when setting NLS_LANG environment variable.
Without setting NLS_LANG connection successful. Perl script with same
parameters successfully connects.



Reproduce code:
---------------
PHP script:
<?php
putenv('ORACLE_HOME=/usr/local/oracle8-client');

//putenv('NLS_LANG=RUSSIAN_CIS.CL8KOI8R');
putenv('NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1');

$dbh = oci_new_connect('user', 'pass', 'DBNAME');

var_dump($dbh);
var_dump(OCIError());

?>

Perl script:

#!/usr/bin/perl
use DBI;

BEGIN {
    $ENV{ORACLE_HOME} = '/usr/local/oracle8-client';
#    $ENV{NLS_LANG} = 'RUSSIAN_CIS.CL8KOI8R';
    $ENV{NLS_LANG} = 'AMERICAN_AMERICA.WE8ISO8859P1';
}

$dbh = DBI->connect("dbi:Oracle:DBNAME", "user", 'pass', {AutoCommit =>
1, PrintWarn => 1, PrintError => 1})
    or die $DBI::errstr;

print $dbh;
print "\n";


Expected result:
----------------
successful connection:
bool(true)

Actual result:
--------------
PHP result:
bool(false)
array(4) {
  ["code"]=>
  int(12705)
  ["message"]=>
  string(59) "ORA-12705: invalid or unknown NLS parameter value
specified"
  ["offset"]=>
  int(0)
  ["sqltext"]=>
  string(0) ""
}
end
Segmentation fault: 11 (core dumped)

Perl result:
DBI::db=HASH(0x8224024)



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


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

Reply via email to