Dear all,
I made a PHP script as follows:
...
putenv("ORACLE_HOME=/afs/cern.ch/project/oracle/@sys/prod");
putenv("LD_LIBRARY_PATH=/afs/cern.ch/project/oracle/@sys/prod/lib");
putenv("TNS_ADMIN=/afs/cern.ch/project/oracle/admin");
putenv("NLS_LANG=american_america.WE8ISO8859P9");
$db = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oradev)(PORT = 10521))(CONNECT_DATA = (SID = D)))";
//$db = "devdb";
$conn = ocilogon("pdbadm", "soleil", $db);
echo "Connection handle: >".$conn."<<br>";
$sql = "select * from persons";
$rs = ociparse($conn, $sql);
ociexecute($rs, OCI_DEFAULT);
while (ocifetch($rs))
echo ociresult($rs, "NAME") . "<br>";
?>
Here I usually get these errors:
Warning: OCISessionBegin: ORA-12705: invalid or unknown NLS parameter value specified in
/afs/cern.ch/project/security/tools/oguest/sessions/uusiks.php on line 26
Connection handle: ><
Warning: Supplied argument is not a valid OCI8-Connection resource in
/afs/cern.ch/project/security/tools/oguest/sessions/uusiks.php on line 31
Warning: Supplied argument is not a valid OCI8-Statement resource in
/afs/cern.ch/project/security/tools/oguest/sessions/uusiks.php on line 32
Warning: Supplied argument is not a valid OCI8-Statement resource in
/afs/cern.ch/project/security/tools/oguest/sessions/uusiks.php
Line 26 is the ocilogon line.
But one time in about 30 reloads get the correct answer:
Connection handle: >Resource id #3<
mark
sue
ray
john
kate
How can this error be like this, that it only occurs sometimes, even though I change nothing in my PHP programs in the meantime?
This is hard to debug, since it sometimes works? I have tried setting up ORACLE_HOME, ORACLE_SID, LD_PRELOAD, LD_LIBRARY_PATH, NLS_LANG and ORA_NLS33 variables. Should I set them up in apachectl script, instead of in the PHP program, like putenv?
Thanks for help,
Jukka