Re: [PHP-DB] Connecting to Oracle DB on another server
Beni, You have two related problems: (i) the error ORA-12154 and (ii) Oracle couldn't find its data file containing the error text to display with ORA-12154. Make sure the standard Oracle environment variables are set in the environment that starts the web server. See http://otn.oracle.com/tech/opensource/php/php_troubleshooting_faq.html#envvars Chris [EMAIL PROTECTED] wrote: Beni ... I am using the same setup as you are describing ... Here is my connect information ... OCILogon($username,$password,$tns_alias) The error that you are getting ORA-12154 has the following text on a lookup ... This leads me to believe that php is unable to find your tnsnames.ora file or the tns entry is invalid. I would try to connect to your DB from sqlplus from your php server [ sqlplus username/[EMAIL PROTECTED] ]. [oracle @ usphdba]: oerr ora 12154 12154, 0, "TNS:could not resolve service name" // *Cause: The service name specified is not defined correctly in the // TNSNAMES.ORA file. // *Action: Make the following checks and correct the error: // - Verify that a TNSNAMES.ORA file exists and is in the proper // place and accessible. See the operating system specific manual // for details on the required name and location. // - Check to see that the service name exists in one of the // TNSNAMES.ORA files and add it if necessary. // - Make sure there are no syntax errors anywhere in the file. // Particularly look for unmatched parentheses or stray characters. // Any error in a TNSNAMES.ORA file makes it unusable. See // Chapter 4 in the SQL*Net V2 Administrator's Guide. If // possible, regenerate the configuration files using the Oracle // Network Manager. Roy A. Jones US Pharma Database Administration GlaxoSmithKline Inc. US Pharma IT, Shared Services Email: [EMAIL PROTECTED] "Beni Buess" <[EMAIL PROTECTED]> 15-Jun-2004 10:14 To [EMAIL PROTECTED] cc Subject [PHP-DB] Connecting to Oracle DB on antother server Hi, I'm trying to connect to an oracle database which is itself on antother server than php is running. on the php machine is an oracle client succesfully installed. i've tried the different functions to connect to oracle: ociplogon('user','pass'); as well as ocinlogon, both with and without the optional third parameter, where i gave the name of the entry in tnsnames.ora as well as the value of ORACLE_SID. i always got a following error message: Warning: ociplogon() [function.ociplogon]: _oci_open_server: Error while trying to retrieve text for error ORA-12154 could anybody point me to the right direction, or is there somebody who has already done such a connection and could give me an example. thanks a lot... Beni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting to Oracle DB on another server
Beni ... I am using the same setup as you are describing ... Here is my connect information ... OCILogon($username,$password,$tns_alias) The error that you are getting ORA-12154 has the following text on a lookup ... This leads me to believe that php is unable to find your tnsnames.ora file or the tns entry is invalid. I would try to connect to your DB from sqlplus from your php server [ sqlplus username/[EMAIL PROTECTED] ]. [oracle @ usphdba]: oerr ora 12154 12154, 0, "TNS:could not resolve service name" // *Cause: The service name specified is not defined correctly in the // TNSNAMES.ORA file. // *Action: Make the following checks and correct the error: // - Verify that a TNSNAMES.ORA file exists and is in the proper // place and accessible. See the operating system specific manual // for details on the required name and location. // - Check to see that the service name exists in one of the // TNSNAMES.ORA files and add it if necessary. // - Make sure there are no syntax errors anywhere in the file. // Particularly look for unmatched parentheses or stray characters. // Any error in a TNSNAMES.ORA file makes it unusable. See // Chapter 4 in the SQL*Net V2 Administrator's Guide. If // possible, regenerate the configuration files using the Oracle // Network Manager. Roy A. Jones US Pharma Database Administration GlaxoSmithKline Inc. US Pharma IT, Shared Services Email: [EMAIL PROTECTED] "Beni Buess" <[EMAIL PROTECTED]> 15-Jun-2004 10:14 To [EMAIL PROTECTED] cc Subject [PHP-DB] Connecting to Oracle DB on antother server Hi, I'm trying to connect to an oracle database which is itself on antother server than php is running. on the php machine is an oracle client succesfully installed. i've tried the different functions to connect to oracle: ociplogon('user','pass'); as well as ocinlogon, both with and without the optional third parameter, where i gave the name of the entry in tnsnames.ora as well as the value of ORACLE_SID. i always got a following error message: Warning: ociplogon() [function.ociplogon]: _oci_open_server: Error while trying to retrieve text for error ORA-12154 could anybody point me to the right direction, or is there somebody who has already done such a connection and could give me an example. thanks a lot... Beni This message may contain legally privileged or confidential information and is therefore addressed to the named persons only. The recipient should inform the sender and delete this message, if he/she is not named as addressee. The sender disclaims any and all liability for the integrity and punctuality of this message. The sender has activated an automatic virus scanning by Messagelabs, but does not guarantee the virus free transmission of this message. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting to Oracle
Joe, I have had some tough problems changing SIDs in oracle via PHP. If your tnsnames.ora file correctly defines the SID, you may not need to declare it again via PHP. if you run phpinfo(), see if these values are already defined, and then try to connect with default values... -- ""Joe Brown"" <[EMAIL PROTECTED]> wrote in message 98loaj$m76$[EMAIL PROTECTED]">news:98loaj$m76$[EMAIL PROTECTED]... > I'm not looking forward to this... Due to circumstances beyond my control, > I will be forced into a similar configuration soon. > > Try putenv("ORACLE_SID=WKDS.world"); > If your sqlnet.ora does does not specify .world as the default domain, then > that may be the problem. > > Was your TNSNAMES.ORA file ftp'd from somewhere to where it is now? > If so, did you use the ascii or text mode option? > > HTH > > "Herbert Groot Jebbink" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello, > > > > I have problems connecting with PHP to Oracle. > > > > - Operating system is Windows 95 > > - Apache version is 1.3.14 > > - The PHP version is 4.04pl1 (NuSphere 1.13.6) > > - The line "extension=php_oracle.dll" is active in php.ini > > - De Oracle Database version is 7.3.4.0.0 > > - De SQL*NET client version is 2.3.4.0.0 > > - Using the SQL PLUS 3.3.4.0.0 client on this machine works fine: > > - The ociw32.dll file is in the path of the webserver > > > > The test program is: > > > > > putenv('ORACLE_HOME=c:\orawin95'); > > putenv("ORACLE_SID=WKDS"); > > $conn = ora_logon("hgj@wkds", "hgj"); > > ?> > > > > The result is: > > > > Warning: Unable to connect to ORACLE (ORA-12154: TNS:could not resolve > > service name) in /www/data/ontwikkel/test/php/test3.php on line 4 > > > > I have lookup the ORA-12154 error and it talks about the tnsnames.ora > > file, this file is located in c:\orawin95\network\admin\ and I have set > > ORACLE_HOME to c:\orawin95, so it must find that file, the part > > of the database in tnsnames.ora is below. > > > > wkds.world = > > (DESCRIPTION = > > (ADDRESS_LIST = > > (ADDRESS = > > (COMMUNITY = tcp.world) > > (PROTOCOL = TCP) > > (Host = rnwux1) > > (Port = 1521) > > ) > > (ADDRESS = > > (COMMUNITY = tcp.world) > > (PROTOCOL = TCP) > > (Host = rnwux1) > > (Port = 1526) > > ) > > ) > > (CONNECT_DATA = (SID = WKDS) > > ) > > ) > > > > > > Greetings, Herbert > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Connecting to Oracle
I'm not looking forward to this... Due to circumstances beyond my control, I will be forced into a similar configuration soon. Try putenv("ORACLE_SID=WKDS.world"); If your sqlnet.ora does does not specify .world as the default domain, then that may be the problem. Was your TNSNAMES.ORA file ftp'd from somewhere to where it is now? If so, did you use the ascii or text mode option? HTH "Herbert Groot Jebbink" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello, > > I have problems connecting with PHP to Oracle. > > - Operating system is Windows 95 > - Apache version is 1.3.14 > - The PHP version is 4.04pl1 (NuSphere 1.13.6) > - The line "extension=php_oracle.dll" is active in php.ini > - De Oracle Database version is 7.3.4.0.0 > - De SQL*NET client version is 2.3.4.0.0 > - Using the SQL PLUS 3.3.4.0.0 client on this machine works fine: > - The ociw32.dll file is in the path of the webserver > > The test program is: > > putenv('ORACLE_HOME=c:\orawin95'); > putenv("ORACLE_SID=WKDS"); > $conn = ora_logon("hgj@wkds", "hgj"); > ?> > > The result is: > > Warning: Unable to connect to ORACLE (ORA-12154: TNS:could not resolve > service name) in /www/data/ontwikkel/test/php/test3.php on line 4 > > I have lookup the ORA-12154 error and it talks about the tnsnames.ora > file, this file is located in c:\orawin95\network\admin\ and I have set > ORACLE_HOME to c:\orawin95, so it must find that file, the part > of the database in tnsnames.ora is below. > > wkds.world = > (DESCRIPTION = > (ADDRESS_LIST = > (ADDRESS = > (COMMUNITY = tcp.world) > (PROTOCOL = TCP) > (Host = rnwux1) > (Port = 1521) > ) > (ADDRESS = > (COMMUNITY = tcp.world) > (PROTOCOL = TCP) > (Host = rnwux1) > (Port = 1526) > ) > ) > (CONNECT_DATA = (SID = WKDS) > ) > ) > > > Greetings, Herbert > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]