Failing to Make Oracle Connection via php4.3.4
| From: | Martin McCormick | Date: | Fri, 19 Mar 2004 19:26:01 +0000 |
| Subject: | Failing to Make Oracle Connection via php4.3.4 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-180994@lists.php.net to get a copy of this message | ||
I am using php4.3.4 Build 5 on FreeBSD4.7 and am totally
stuck. For about a week, I have been trying to write a php script
that will access an Oracle server on a different system over the
network.
I can't seem to let php know where to look to find all the
contact information such as is supposed to reside in tnsnames.ora. At
least, I haven't found a place to put tnsnames.ora that tns
recognizes.
I got word from the maintainer of the FreeBSD port of php4.3
that the oci8 functions are not accessible. The exact words were:
> You cannot build and use the oci8 extension. You may only use the oracle
> extension.
I do have the ora_x functions such as ora_logon but I am not
even sure how far I can get.
The database server uses an Oracle8I data base. I am also not
using php in a web development setting, but will be using it to get
and put data via SQL statements in to the Oracle server.
I have the IP address of the server and the port number, all
of which I put in to the tnsnames.ora file and which I planted in
about every directory that might possibly work. None did.
Here is the test script command I am running followed by the
sqlnet.log output. Rarely have I seen a diagnostic that says so much
and tells me so little about what I may have failed to do.:-)
Test script follows with server name changed to protect the innocent:
#!/usr/local/bin/php
<?
//Set env variables
//Maybe something goes here, but I am not sure what.
putenv("");
//Login to SQL
$conn= Ora_Logon("db_IDname@server_tnsname", "password",);
//Process each record
?>
Here's what happens. Lines have been broken to fit the screen:
Fatal OSN connect error 12545, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=oracle)
(ARGV0=oracle)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
')(DE
VERSION INFORMATION:
TNS for Intel SVR4 UNIX: Version 2.3.2.1.0 - Production
Oracle Bequeath NT Protocol Adapter for Intel SVR4 UNIX: Version
2.3.2.1.0 - Production
Time: 19-MAR-04 11:17:55
Tracing not turned on.
Tns error struct:
nr err code: 12206
TNS-12206: Message 12206 not found; No message file for
product=NETWORK, facility=TNS
ns main err code: 12545
TNS-12545: Message 12545 not found; No message file for
product=NETWORK, facility=TNS
ns secondary err code: 12560
nt main err code: 515
TNS-00515: Message 515 not found; No message file for
product=NETWORK, facility=TNS
Martin McCormick WB5AGZ Stillwater, OK
OSU Information Technology Division Network Operations Group