Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    79

    Unanswered: Accessing oracle using PHP

    Hi,

    I am trying simialr oracle connectivity
    But I get this error :
    Warning: ocilogon(): _oci_open_server:

    at line number:
    $conn = ocilogon("scott", "tiger", $db);

    My whole script is:

    <?


    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)
    )
    )";


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





    ?>


    any clues appreciated
    Thanks in advance

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: Accessing oracle using PHP

    Originally posted by sampav
    Hi,

    I am trying simialr oracle connectivity
    But I get this error :
    Warning: ocilogon(): _oci_open_server:

    at line number:
    $conn = ocilogon("scott", "tiger", $db);

    My whole script is:

    <?


    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)
    )
    )";


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





    ?>


    any clues appreciated
    Thanks in advance
    This is PHP related question, so go to the PHP section please.
    <snip>


    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)
    )
    )";
    </snip>
    BTW this is not good way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •