Re: Re: Connecting to Oracle

From: Date: Wed, 14 Mar 2001 04:30:41 +0000
Subject: Re: Re: Connecting to Oracle
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-7433@lists.php.net to get a copy of this message
Brian, Thanks for the solution, that is a good one. I imagine you can set the environment variable oracle_sid this way also. ORACLE_SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.68.10.1)(PORT=1521) )(CONNECT_DATA=(SID=TEST))) re: TNSNAMES.ORA It seems to be a fairly common occurence where a tnsnames.ora file is transferred to a linux box from a dos box. This transferrence sometimes does not perform a text file conversion on the tnsnames.ora file. That being the case, the lines are terminated with <CR><LF> (carriage return and line feed) characters. Oracle on Linux does not like this. If that is the case, when you use vi and examin the file, it should tell you it is a dos file. type ":set ff=unix" and ":x" to save and exit will convert the file. The other thing to keep in mind is that the user "nobody" or whomever user your webserver runs as, has permissions to the TNSNAMES.ORA file, including all directories leading up to the TNSNAMES.ORA file. ""Brian.J.Mauter"" <maute001@bama.ua.edu> wrote in message news:Pine.GSO.4.30.0103132114140.10067-100000@bama.ua.edu... > Hey, I'm using Oracle with PHP. I never could get the blasted thing to > work right. What I ended up doing was something similar to this: > > $db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.68.10.1)(PORT=1521))(CONNECT_ DATA=(SID=TEST)))"; > $conn = OCILogon("scott", "tiger", $db); > > From what I can tell, this completely lets PHP ignore your tnsnames.ora > file. So if you're having some rather interesting trouble connecting with > environment variables, give that a shot. The only things you'll have to > replace are the SID and the IP address. :) > > -Brian > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#7433) next »