php connectivity to oracle

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sam2004
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2004 1:33 pm

php connectivity to oracle

Post by sam2004 »

Hi
We are trying to move data froma ccess to oracle.
wrote a php script for oracle connectivity;
Getting this error:

Warning: ocilogon(): _oci_open_server:

at Line number:
if ($c=OCILogon("scott", "tiger",$db)) {

Full code is as follows:

<?


putenv('ORACLE_HOME=C:\oracle\ora92');
putenv('ORACLE_SID=bookKeeper);
putenv('TNS_ADMIN=C:\oracle\ora92\network\admin');
//putenv('NLS_LANG=English_America.WE8ISO8859PL');
//en_US
putenv("TWO_TASK=bookKeeper");


$db = "(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = iabetaweb)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = bookKeeper)
)
)";

//$conn = ocilogon("scott", "tiger", $db);

if ($c=OCILogon("scott", "tiger",$db)) {
echo "Successfully connected to Oracle.\n";
OCILogoff($c);
} else {
$err = OCIError();
echo "Oracle Connect Error " . $err[text];
exit();
}


Wondering why

Thanks in advance!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Is 'scott' your database username and 'tiger' your database password for sure? Just making sure...
sam2004
Forum Newbie
Posts: 6
Joined: Wed Mar 17, 2004 1:33 pm

Post by sam2004 »

scott/tiger is what the system tells us as username/password.
i did not create this user "scott".
its like the default username/password combo for sql and SQLPlus editor.
Thanks
Post Reply