Connecting to remote oracle database - Is the same as a local database, but the remote database must be
configured in your tnsnames.ora - its then provided to PHP by way of
tns...

解决方案 »

  1.   

    here my working sample code (php4 on debian, oracle 8.1.5.0.2 client,
    oracle 8i enterprise server on win2k)$user = "scott";
    $pass = "tiger";
    $tns_name = "my_service_name_in_tnsnames.ora";// set ORACLE Dir to get the NET8 name resolver working
    // tnsnames.ora has to be in $ORACLE_HOME/networking/admin/
    putenv("ORACLE_HOME=/home/oracle01/app/oracle/product/8.1.5");// log on to oracle server using data above
    $db_id = OCILogon ($user, $pass, $tns_name);