I've successfully installed XAMPP on a WinXP Pro machine. Enabled the oracle "oci8" extension. And.. after installing an Oracle 10 database on the machine.. I sucessfully wrote functionality in PHP to query the local Oracle DB , fetch the information, before inserting into a local MySQL database for reporting purposes.... all worked just perfect.
Now... since the development machine isn't the *production* machine, I've had to move it to another machine that *doesn't* have an Oracle DB installed on it. I can access the remote Oracle DB knowing the IP address, User, Password, and instance name perfectly using an "Oracle SQL Developer" tool downloaded from Oracle.
However, when I try to access the remote Oracle DB by just changing the *localhost* to the IP address.. and making the appropriate User, Password, and Instance name changes.... I get a ORA-12545 error saying:
Warning: oci_new_connect() [function.oci-new-connect]: ORA-12545: Connect failed because target host or object does not exist in C:\xampp\htdocs8001\www\oratest2.php on line 18
.. which line 18 in the "oratest2.php" connects like this:
$c = oci_new_connect("mduser", "mdpass", "mindb");
Before I added a 'TNSNAMES.ORA" file, I was receiving TNS Listner type errors saying that the listener couldn't locate where the remote DB was located.
I *have* setup a "tnsnames.ora" file in the place where the oracle client libraries are in c:\ora\client\win that looks like this:
Currently, TNS_ADMIN is set in the "oratest2.php" file with a:
And the value of TNS_ADMIN is placed before %PATH% in the environment.
When I look at the c:\xampp\sqlnet.log it says:
Fatal NI connect error 12545, connecting to:
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows: Version 10.2.0.3.0 - Production
Time: 22-JAN-2007 11:59:13
Tracing not turned on.
Tns error struct:
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
nt secondary err code: 1004
nt OS err code: 0
In order to try this like the *production* machine, I've even de-installed the local Oracle DB from the development workstation and rebooted.. and still get the same error.
So far.. this works beautifully for a local Oracle DB.. but I am not able right now to get it to access a remote Oracle DB. Are the instant clients *not* supposed to work with a remote Oracle DB?
Any help would be appreciated.
When I try to connect with (with no TNS_ADMIN defined)
$c = oci_new_connect("$user", "$pswd", "//$host:$port/$db");
I get an Ora-12545 error. Even if I *hardcode* the values and don't use variables.. the same thing occurs.
When I try to connect with (with TNS_ADMIN defined):
$c = oci_new_connect('mduser', 'mdpass', 'mindb'); -or-
$c = oci_new_connect("$user", "$pswd", "$tns");
Also get a Ora-12545