Page 1 of 1

Connect to Oracle 10

Posted: Fri Dec 04, 2009 8:10 am
by papa
Hi,

I'm trying to connect to an Oracle (10) db but can't get it to work.

Doesn't seem that you have to do that much. I activated the extension php_pdo_oci.dll in php.ini and restarted Apache.

I get:
could not find driver

Code: Select all

 
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1); 
 
$username = "xxx";
$password = "xxx";
$host = "xxx";
$dbname = "xxx";
 
try {
    $dbh = new PDO("OCI:dbname=$dbname", $username, $password);
    }
catch (PDOException $e)
    {
    echo $e->getMessage();
    }
?>
 
Been reading about it but don't understand why my extension doesn't work or what I'm doing wrong.

Running Windows XP, PHP 5+, Apache 2+

Re: Connect to Oracle 10

Posted: Mon Dec 07, 2009 2:21 am
by papa
*bump*

Re: Connect to Oracle 10

Posted: Tue Dec 08, 2009 2:03 am
by papa
I got it to work without using PDO and changing my tns a bit.

Most likely there is something wrong with my Oracle client.