Re: Still can't talk to the Oracle

From: Date: Fri, 16 Feb 2001 00:43:41 +0000
Subject: Re: Still can't talk to the Oracle
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40036@lists.php.net to get a copy of this message
----- Original Message ----- From: Kristofer Widholm <qit@bigfoot.com> Newsgroups: php.general Sent: Tuesday, February 13, 2001 5:29 PM Subject: [PHP] Still can't talk to the Oracle > I'm setting up a back end production system for a television show, > and have been given space on a development server with PHP 4 and > Oracle support compiled in (but not the OCI libraries). The Oracle > admin have given me my user name (let's say ora_user), a TNS name > (tns_name), and a password (ora_pass). > > So I write code as follows... You may need to set ORACLE_HOME etc in PHP's environment: SetEnv("ORACLE_HOME=/path/to/oracle/home/dir"); SetEnv("ORACLE_GOD_KNOWS_WHAT_ELSE=/oracle/changes/it/every/release"); > if ($conn=ora_logon("ora_user@tns_name","ora_pass")) { > echo "SUCCESS ! Connected to database\n"; > } else { > echo "Failed :-( Could not connect to database\n"; > echo ora_errorcode($conn).": ".ora_error($conn)."<BR>"; > } > > In response to this code, I get the following error: > ORA-12154 "Supplied argument is not a valid Oracle-Connection/Cursor > resource in ...." > > From reading php.net documentation on ora_logon, it seemed that maybe > the ORACLE_HOME environment variable simply hadn't been set. > > I had the sys admins set it. > > And I still get the error. > > Any ideas from an experienced PHP/Oracle developer? Also, if $conn isn't a valid connection, ora_errorcode() probably can't be used on it. It's a chicken and egg problem -- Until you have a valid connection, you can't get the error message about why the connection failed... Try echo $php_errormsg -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#40036) next »