I get a problem when I try to connect to an Oracle database, this is my code:

<head>
<title>Oracle</title>
</head>
<body>
</body>
<?
$conn = ocilogon("daniel", "daniel", "myHost");
if ($conn){
ocilogoff($conn);
echo "Connection successful";
}
else{
echo "Connection fails";
} // if
?>

When I execute my code, PHP does not found oci functions.

Any suggestion?

Thanks

Daniel Baylon
dbaylon@infolinksa.com

    I don't use the oci functions, but I have set up connections/queries to a production Oracle database running under AIX. I'm using php3 (I can't get php4 to compile in the Oracle libs on AIX, isn't a problem under linux however).

    This seems to work for me:

    <?php
    $conn = ora_logon("davs/david@cats");
    if ($conn){
    ora_logoff($conn);
    echo "Connection successful";
    }
    else{
    echo "Connection fails";
    }

    ?>

    Hope this helps a little.

      Hi,

      Did you configure PHP with OCI8 Support ?

      ./configure --with-oci8=$ORACLE_HOME ...

      JBL

        3 months later

        in Nt2000 IIs5 php4.02
        I can connect oracle(unix) with odbc,but
        use oci_xxx is fatalerror:call to undefinedfunction ocilogin()...
        Can you tell me How to do
        ./configure --with-oci8=$ORACLE_HOME

        thanks!

          4 months later

          The problem we are facing is .....

          1. We are not able to deploy the site on client's system, which otherwise is working fine on the server system in our office..

          2. Database has been successfully transfered and the DSN is set up according to the specifications given by the programmer who
            has developed the site. But the database - file communication is not happening

          3. We are unable to locate the connection parameters in the source code so that we can change any path, localhost name and
            DSN name if required.

          4. The error message we get when we try to login the site ...

            Warning: SQL error: [Oracle][ODBC][Ora]General error., SQL state S1000 in SQLConnect in
            E:\photoweb\site5 \PHPLib\db_odbc.inc on line 38

            Warning: Supplied argument is not a valid ODBC-Link resource in E:\photoweb\site5\PHPLib\db_odbc.inc on line 39
            Database error: Link-ID == false, odbc_pconnect failed
            ODBC Error: 0 ()
            Session halted.
            Please reply to durrani@comatindia.com

            Write a Reply...