Re: Cliente Oracle8 + Apache + Windows + PHP4

From: Date: Thu, 30 Nov 2000 21:21:11 +0000
Subject: Re: Cliente Oracle8 + Apache + Windows + PHP4
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-4205@lists.php.net to get a copy of this message
Leonardo Rezende wrote: > Hi, > I'm trying to connect with my Oracle server and i'm having some problems... > > When I try to connect using OCILogon raises an warning:"Warning: Oracle: > Connection Failed: ORA-12154: TNS:could not resolve service name in > c:\arquivos de programas\apache group\apache\htdocs\index.php on line 25" > > I don't no what is wrong... I visited php.net site and saw I have to set > some environment variables like ORACLE_HOME, ORACLE_SID, LD_PRELOAD, > LD_LIBRARY_PATH, NLS_LANG, ORA_NLS33... I don't no where I can declare these > variables... Just the quick overview :) 1) Make sure you're using Oracle Client 8.1.6 with oci8 extension. 2) Add ONLY the ORACLE_HOME and TNS_ADMIN environment variables to your Apache httpd.conf file... like this: SetEnv ORACLE_HOME "c:/oracle/ora81" SetEnv TNS_ADMIN "c:/oracle/ora81/network/admin" These need to reflect your local directory structure, of course. All other env vars shouldn't be necessary within Apache/PHP 3) Make sure you define your Oracle Database instance within Net8 Assistant using Oracle 8.0 naming compatibility (basically, you should use SID naming, not the new "Service Name" convention) 4) When calling OCILogon, use the following call-convention: $conn = ocilogon("<my_username>","<my_password>","<my_sid>"); There are some other intricasies which may be necessary, but those are the basics to try. Let us know what happens. -- Andy Hoffman Web Developer Bristol-Myers Squibb email: andy.hoffman@bms.com

« previous php.windows (#4205) next »