Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Connect php to oracle
I am running php 4.3.3 on Windows 2000 server/IIS5.
I have not yet been able to connect PHP to my Oracle 9 database running on
another server.
I have installed Oracle Client software on the server. When I try to run
this php test page:
PutEnv("ORACLE_HOME=C:\oracle\ora92"); PutEnv("TNS_ADMIN=C:\oracle\ora92\network\admin"); PutEnv("TWO_TASK=C:\oracle\ora92\network\admin\tnsnames.ora");
(ADDRESS = (PROTOCOL = TCP) (Host = <server ip>) (Port = 1521))
$c = OCILogon("user", "password");
if ($c) {
echo "Successfully connected to Oracle.\n";
echo "LOGON";
ocilogoff();
} else {
$err = ocierror();
echo "Oracle Connect Error " . $err[0];
}
?>
Connection Test
Warning: ocilogon(): _oci_open_server: Error while trying to retrieve text
for error ORA-12538 in c:\inetpub\wwwroot\oci8test.php on line 17
Oracle Connect Error
When I try tnsping it tells me everything is up and running, and connecting to the Oracle database with sqlplus from the Windows server works fine.
Environment settings TNS_ADMIN and ORACLE_HOME have been set using "My Computer" -> "advanced" ->.... too.
Connecting to an MSSQL database works perfectly.
I hope someone out there can help me with a solution to this problem? I have spent far too many hours trying to figure it out on my own...
-- regards, Tore Skogly,Norway E-mail:tskogly_at_start.noReceived on Wed Jan 07 2004 - 16:55:52 CST