Oracle7.3+PHP4.x+Apache3.11

wxdqz

New Member
I磀 like to make a remote conection between PHP4 and a Oracle DB.
I have PHP4 and Apache with WindowsNT, and Personal Oracle 7.3 in the same machine, I configure the remote DB with SQLPlus 3.3, the remote DB is on Unix machine.

<?php
//crea la conexion
putenv("ORACLE_HOME=c:\orawinNT");
putenv("TNS_ADMIN=c:\orawinNT\network\admin");
putenv("ORACLE_SID=ORCL");

//************************************
// This doesn't work

$mistring="(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = 146.83.107.55)(Port = 1521)))(CONNECT_DATA = (SID = ORCL)))";

$conexion=ora_logon("cafe","micafe",$mistring) or die("no se puede hacer logon.");

//**********************************

// I try with both:
//$conexion=ora_logon("[email protected]","micafe") or die("no se puede hacer logon.");

//$conexion=ora_logon("cafe@aliascafe","micafe") or die("no se puede hacer logon.");

//******* and doesn't work
//crea el cursor
$cursor=ora_open($conexion);

The tnsnames.ora look like this:

aliascafe.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 146.83.107.55)
(Port = 1521)
)
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = 146.83.107.55)
(Port = 1526)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)

I don't know what can I do.
The error is: Undefined Tnsname ORA-12154 or
invalid username/password ORA-01017. With Personal Oracle I can connect to remote DB, but with PHP...
Please help me.
 
Back
Top