Cendler85 Posted September 14, 2007 Share Posted September 14, 2007 Hi all, I'm an italian programmer and i have a very big problem: i must connect to Oracle DB. The error log is: Warning: ocilogon() [function.ocilogon]: OCIEnvNlsCreate() failed. There is something wrong with your system - please check that ORACLE_HOME is set and points to the right directory in /var/www/phpnuke/html/modules/FAQ/index.php on line 266 Errore nella scelta del database The code is: PutEnv("ORACLE_SID=XE"); PutEnv("ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server"); PutEnv("TNS_ADMIN=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin"); $db = "XE"; $sql = "SELECT * FROM DEFECT"; $cn = OCILogon("smc","smc",$db)or die('Errore nella scelta del database'); $stmt = OCIParse($cn,$sql) or die ("Couldn't parse statement."); OCIExecute($stmt) or die ("Couldn't execute query."); while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) { print "ID: ".$row[iD]."<br>"; } OCIFreeStatement($stmt); OCILogoff($cn); Can you help me? I offer a ham on Christmas Time the first one that help me Thanks Quote Link to comment https://forums.phpfreaks.com/topic/69390-php-oracle-db/ Share on other sites More sharing options...
cjbj Posted September 25, 2007 Share Posted September 25, 2007 Avoid using putenv() because it is error prone, inconsistent, and unportable. Make sure the environment is set in the shell that starts Apache. There is a bunch of other information in my free Underground PHP and Oracle Manual at http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf -- cj Quote Link to comment https://forums.phpfreaks.com/topic/69390-php-oracle-db/#findComment-355276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.